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 d7607923be
commit d84193f444
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
1 changed files with 2 additions and 2 deletions

View File

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