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:
@@ -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])?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user