fix(ocr_queue): don't slam the DB while we wait
This commit is contained in:
parent
b2a7faaddb
commit
babe5a6e46
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue