Automattic / Automattic/kue

TTL - Queue Events

Open
#1,000 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Hi All,

Is it possible to catch ttl exceeded events at the queue level?

I am struggling to catch ttl events on a specific job, I do not seem to get the event emitted.

Would something like this work?

`queue.on('job enqueue', function(id, type){
console.log( 'Job %s got queued of type %s', id, type );

}).on('job complete', function(id, result){
kue.Job.get(id, function(err, job){
if (err) return;
job.remove(function(err){
if (err) throw err;
console.log('removed completed job #%d', job.id);
});
});
});`

Thanks in advance!

Jon

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the queue.on('job enqueue') and 'job complete' handlers shown in the issue, then trace how TTL expiry is represented. Done means establishing whether a queue-level TTL event can be caught and identifying the supported event behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.