fix(ocr_queue): don't slam the DB while we wait

This commit is contained in:
perf3ct 2025-06-17 14:45:44 +00:00
parent b2a7faaddb
commit babe5a6e46
1 changed files with 2 additions and 2 deletions

View File

@ -534,8 +534,8 @@ impl OcrQueueService {
} }
Ok(None) => { Ok(None) => {
// No items in queue or all jobs were claimed by other workers // No items in queue or all jobs were claimed by other workers
// Use shorter sleep for high-concurrency scenarios // Use exponential backoff to reduce database load when queue is empty
sleep(Duration::from_millis(100)).await; sleep(Duration::from_secs(5)).await;
} }
Err(e) => { Err(e) => {
error!("Error dequeuing item: {}", e); error!("Error dequeuing item: {}", e);