Refactor SQL query in Worker to improve distance calculations: Replace the existing LEFT JOIN with a LATERAL join to enhance the selection of region distances based on transport mode, ensuring more accurate results. Update polling frequency in TransportWorker from once per second to once per minute for better resource management.

This commit is contained in:
Torsten Schulz (local)
2025-12-20 22:20:29 +01:00
parent cd1b33a474
commit 833202344b
3 changed files with 30 additions and 7 deletions

View File

@@ -51,8 +51,8 @@ impl TransportWorker {
eprintln!("[TransportWorker] Fehler in process_arrived_transports: {err}");
}
// Einmal pro Sekunde prüfen
for _ in 0..1 {
// Minütlich prüfen (nicht sekündlich pollen)
for _ in 0..60 {
if !state.running_worker.load(Ordering::Relaxed) {
break;
}