Refactor worker modules: Added watchdog stop in BaseWorker, improved debug logging in PoliticsWorker, and removed unused credit_id in UserCharacterWorker.

This commit is contained in:
Torsten Schulz (local)
2025-11-21 23:25:59 +01:00
parent d0ec363f09
commit f9d869ee23
3 changed files with 18 additions and 7 deletions

View File

@@ -488,11 +488,18 @@ impl PoliticsWorker {
let required = parse_i32(&row, "required_count", 0);
let occupied = parse_i32(&row, "occupied_count", 0);
if region_id >= 0 {
result.push(OfficeCounts {
let oc = OfficeCounts {
region_id,
required,
occupied,
});
};
// Felder aktiv nutzen: einfache Debug-Ausgabe kann später
// durch Logging ersetzt werden.
eprintln!(
"[PoliticsWorker] Region {}: required={}, occupied={}",
oc.region_id, oc.required, oc.occupied
);
result.push(oc);
}
}
@@ -659,6 +666,11 @@ impl PoliticsWorker {
conn.prepare("notify_office_filled", QUERY_NOTIFY_OFFICE_FILLED)?;
for office in new_offices {
// Debug-Logging mit allen Feldern, damit sie aktiv genutzt werden
eprintln!(
"[PoliticsWorker] Office filled: id={}, type={}, character={}, region={}",
office.office_id, office.office_type_id, office.character_id, office.region_id
);
conn.execute("notify_office_filled", &[&office.character_id])?;
}