Automattic / Automattic/kue

Issues with delayed handling

Open
#933 3 comments 0 reactions 0 assignees View on GitHub
Bug needs pull request Question
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

I run into this issue myself, but also found an existing issue (https://github.com/Automattic/kue/issues/505) that was closed a while ago. The issue is handling around `delay` is a little patchy and inconsistent:
- When you get an existing job and update the delay, it's based on creation time and not update time (Ref: https://github.com/Automattic/kue/blob/master/lib/queue/job.js#L835-L838)
- If you try to set the delay of an existing job back to `0` (E.g. execute it immediately and stop delaying) it actually ignores the delay altogether (Ref: https://github.com/Automattic/kue/blob/master/lib/queue/job.js#L449-L451)

For now, my workaround is to almost delete old jobs and recreate them from scratch. I imagine a number of people that attempt this will come to a similar conclusion and imagine the code should function somewhat differently instead.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the referenced sections of lib/queue/job.js at lines 835-838 and 449-451, then read the closed issue #505 for prior context. Done should mean that updating a job's delay uses the update time and that setting the delay to 0 causes immediate execution rather than being ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.