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

@@ -71,7 +71,10 @@ impl BaseWorker {
}
pub(crate) fn stop_worker(&mut self) {
// Erst den Worker stoppen, dann auch den Watchdog beenden, damit keine
// Hintergrund-Threads weiterlaufen.
self.state.running_worker.store(false, Ordering::Relaxed);
self.stop_watchdog();
if let Some(handle) = self.worker_thread.take() {
let _ = handle.join();
}
@@ -111,9 +114,7 @@ impl BaseWorker {
}
}
pub(crate) fn is_running(&self) -> bool {
self.state.running_worker.load(Ordering::Relaxed)
}
// Bei Bedarf kann hier später wieder ein expliziter Statuszugriff ergänzt werden.
}
const QUERY_UPDATE_MONEY: &str = r#"