Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoveOnComplete: [number] per job, not supported or not working? #1299

Closed
augusto-joecoffee opened this issue Jun 30, 2022 · 2 comments
Closed
Labels
question Further information is requested

Comments

@augusto-joecoffee
Copy link

augusto-joecoffee commented Jun 30, 2022

Hello!
Wondering if this is not supported/bugged or if i'm missing something on my implementation.

Basically i'm trying to only keep 1 completed repeatable job per job type.

Let's say i have the following repeatable jobs:

  • Cron 1
  • Cron 2

I'm attempting to keep on my completed list only the last time Cron 1 and Cron 2 ran.

I'm attempting this by passing removeOnComplete: 1 when enqueuing a repeatable job.

 await queue.add('cron1', jobData, { removeOnComplete: 1 });

The problem i'm having is that when cron1 runs it will clear the whole completed list and only leave the last cron1.
All other jobs are removed, It would seem that removeOnComplete is being set for the whole queue and not to this specific job.

Is this working as expected?

thanks!

@roggervalf roggervalf added the question Further information is requested label Jul 1, 2022
@roggervalf
Copy link
Collaborator

hi @augusto-joecoffee, you are right, by design it is being set for the whole queue, not for specific job

@augusto-joecoffee
Copy link
Author

Ok, thank you!
Wouldn't mind having that feature in the future 😉

Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants