Skip to content

Commit 8bf82e8

Browse files
committed
Do not use burst behavior when job queue ticks take too long
1 parent bbf54f9 commit 8bf82e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

site/src/job_queue/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use database::{
1111
};
1212
use parking_lot::RwLock;
1313
use std::{str::FromStr, sync::Arc};
14-
use tokio::time::{self, Duration};
14+
use tokio::time::{self, Duration, MissedTickBehavior};
1515

1616
pub fn run_new_queue() -> bool {
1717
std::env::var("RUN_CRON")
@@ -372,6 +372,8 @@ async fn cron_enqueue_jobs(ctxt: &SiteCtxt) -> anyhow::Result<()> {
372372
/// Entry point for the cron job that manages the benchmark request and job queue.
373373
pub async fn cron_main(site_ctxt: Arc<RwLock<Option<Arc<SiteCtxt>>>>, run_interval: Duration) {
374374
let mut interval = time::interval(run_interval);
375+
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
376+
375377
let ctxt = site_ctxt.clone();
376378

377379
loop {

0 commit comments

Comments
 (0)