mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-27 00:56:36 +02:00
fixup! fix: Use to_str methods on room IDs
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 1s
Rust Checks / Clippy (push) Failing after 10s
Rust Checks / Cargo Test (push) Failing after 8s
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 1s
Rust Checks / Clippy (push) Failing after 10s
Rust Checks / Cargo Test (push) Failing after 8s
This commit is contained in:
parent
e781d16eaa
commit
32c83a89fb
1 changed files with 14 additions and 9 deletions
|
@ -74,11 +74,12 @@ pub(super) async fn purge_sync_tokens(&self, room: OwnedRoomOrAliasId) -> Result
|
||||||
|
|
||||||
// Delete all tokens for this room using the service method
|
// Delete all tokens for this room using the service method
|
||||||
let Ok(deleted_count) = self.services.rooms.user.delete_room_tokens(&room_id).await else {
|
let Ok(deleted_count) = self.services.rooms.user.delete_room_tokens(&room_id).await else {
|
||||||
return Err!("Failed to delete sync tokens for room {}", room_id);
|
return Err!("Failed to delete sync tokens for room {}", room_id.as_str());
|
||||||
};
|
};
|
||||||
|
|
||||||
self.write_str(&format!(
|
self.write_str(&format!(
|
||||||
"Successfully deleted {deleted_count} sync tokens for room {room_id}"
|
"Successfully deleted {deleted_count} sync tokens for room {}",
|
||||||
|
room_id.as_str()
|
||||||
))
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -132,14 +133,14 @@ pub(super) async fn purge_all_sync_tokens(
|
||||||
match target {
|
match target {
|
||||||
| RoomTargetOption::DisabledOnly => {
|
| RoomTargetOption::DisabledOnly => {
|
||||||
if !self.services.rooms.metadata.is_disabled(room_id).await {
|
if !self.services.rooms.metadata.is_disabled(room_id).await {
|
||||||
debug!("Skipping room {} as it's not disabled", room_id);
|
debug!("Skipping room {} as it's not disabled", room_id.as_str());
|
||||||
skipped_rooms = skipped_rooms.saturating_add(1);
|
skipped_rooms = skipped_rooms.saturating_add(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
| RoomTargetOption::BannedOnly => {
|
| RoomTargetOption::BannedOnly => {
|
||||||
if !self.services.rooms.metadata.is_banned(room_id).await {
|
if !self.services.rooms.metadata.is_banned(room_id).await {
|
||||||
debug!("Skipping room {} as it's not banned", room_id);
|
debug!("Skipping room {} as it's not banned", room_id.as_str());
|
||||||
skipped_rooms = skipped_rooms.saturating_add(1);
|
skipped_rooms = skipped_rooms.saturating_add(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -189,13 +190,17 @@ pub(super) async fn purge_all_sync_tokens(
|
||||||
match self.services.rooms.user.count_room_tokens(room_id).await {
|
match self.services.rooms.user.count_room_tokens(room_id).await {
|
||||||
| Ok(count) =>
|
| Ok(count) =>
|
||||||
if count > 0 {
|
if count > 0 {
|
||||||
debug!("Would delete {} sync tokens for room {}", count, room_id);
|
debug!(
|
||||||
|
"Would delete {} sync tokens for room {}",
|
||||||
|
count,
|
||||||
|
room_id.as_str()
|
||||||
|
);
|
||||||
total_tokens_deleted = total_tokens_deleted.saturating_add(count);
|
total_tokens_deleted = total_tokens_deleted.saturating_add(count);
|
||||||
} else {
|
} else {
|
||||||
debug!("No sync tokens found for room {}", room_id);
|
debug!("No sync tokens found for room {}", room_id.as_str());
|
||||||
},
|
},
|
||||||
| Err(e) => {
|
| Err(e) => {
|
||||||
debug!("Error counting sync tokens for room {}: {:?}", room_id, e);
|
debug!("Error counting sync tokens for room {}: {:?}", room_id.as_str(), e);
|
||||||
error_count = error_count.saturating_add(1);
|
error_count = error_count.saturating_add(1);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -207,10 +212,10 @@ pub(super) async fn purge_all_sync_tokens(
|
||||||
debug!("Deleted {} sync tokens for room {}", count, room_id.as_str());
|
debug!("Deleted {} sync tokens for room {}", count, room_id.as_str());
|
||||||
total_tokens_deleted = total_tokens_deleted.saturating_add(count);
|
total_tokens_deleted = total_tokens_deleted.saturating_add(count);
|
||||||
} else {
|
} else {
|
||||||
debug!("No sync tokens found for room {}", room_id);
|
debug!("No sync tokens found for room {}", room_id.as_str());
|
||||||
},
|
},
|
||||||
| Err(e) => {
|
| Err(e) => {
|
||||||
debug!("Error purging sync tokens for room {}: {:?}", room_id, e);
|
debug!("Error purging sync tokens for room {}: {:?}", room_id.as_str(), e);
|
||||||
error_count = error_count.saturating_add(1);
|
error_count = error_count.saturating_add(1);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue