Skip to content
Discussion options

You must be logged in to vote

Hmmm, have you considered replacing this with a sql query?

for state in states_to_cancel {
        let mut page = 0;
        loop {
            let jobs = match updates_store.list_jobs(&state, page).await {
                Err(e) => {
                    error!("Failed to list jobs: {e}");
                    break;
                },
                Ok(jobs) => jobs
            };

            if jobs.len() == 0 {
                break;
            }

            for job in jobs {
                debug!("Cancelling: {:?} ({:?})", job.parts.context.task_id, job.args);
                if let Ok(Some(mut job)) = updates_store.fetch_by_id(&job.parts.context.task_id).await {

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@liamdiprose
Comment options

@geofmureithi
Comment options

@liamdiprose
Comment options

Answer selected by geofmureithi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #598 on September 03, 2025 04:09.