Enhance relationship deletion logging across workers: Implement detailed logging for the number of deleted relationships in CharacterCreationWorker, EventsWorker, and UserCharacterWorker, improving traceability and user awareness during character interactions.

This commit is contained in:
Torsten Schulz (local)
2026-01-23 10:46:32 +01:00
parent 7305a71438
commit 0399333163
4 changed files with 37 additions and 7 deletions

View File

@@ -582,6 +582,16 @@ impl UserCharacterWorker {
// Relationships löschen mit Logging und spezieller Notification für Verlobungen
let rel_result = conn.execute("delete_relationship", &[&character_id])?;
// Logging: Anzahl gelöschter Relationships
let deleted_count = rel_result.len();
if deleted_count > 0 {
eprintln!(
"[UserCharacterWorker] {} Relationship(s) gelöscht für character_id={}",
deleted_count, character_id
);
}
for row in rel_result {
let related_user_id = row
.get("related_user_id")
@@ -596,9 +606,9 @@ impl UserCharacterWorker {
// Logging: Relationship wurde gelöscht
eprintln!(
"[UserCharacterWorker] Relationship gelöscht: character_id={}, related_character_id={}, related_user_id={:?}, relationship_type={:?}",
"[UserCharacterWorker] Relationship gelöscht: character_id={}, related_character_id={:?}, related_user_id={:?}, relationship_type={:?}",
character_id,
related_character_id.unwrap_or(-1),
related_character_id,
related_user_id,
relationship_type_tr
);