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

[feat] removal of one time jobs after worker completes #106

Closed
hdrodel opened this issue Jun 2, 2021 · 2 comments
Closed

[feat] removal of one time jobs after worker completes #106

hdrodel opened this issue Jun 2, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hdrodel
Copy link

hdrodel commented Jun 2, 2021

there is the following example:
// runs./jobs/worker-8.jsat midnight (once) { name: 'worker-8', timeout: 'at 12:00 am' },

in my usecase i am running a job every 30 minutes that queries an api and dynamically adds jobs to be executed once.
My question is what happenes to the jobs in the queue after they are executed. Will finished jobs be cleared out automatically or will that cause the queue to get huge containing tons of old finished jobs?

@shadowgate15
Copy link
Member

The worker will delete when the job has finished but the job will not be removed from the queue.

I do not know what your setup is but it is best practice to have jobs be as standard as possible and use a DB to facilitate the data for the job.

For dynamically added jobs you could add a listener to bree for worker deleted and delete the job upon completion of the worker. Another alternative could be to add a listener to the worker, this way you could also see the process code and respond accordingly.

@shadowgate15 shadowgate15 added the question Further information is requested label Jun 2, 2021
@shadowgate15
Copy link
Member

might be good to have a config option for removal of one-time jobs after a certain amount of time or just have an option on the job to remove after completion.

@shadowgate15 shadowgate15 added enhancement New feature or request good first issue Good for newcomers and removed question Further information is requested labels Jul 10, 2021
@shadowgate15 shadowgate15 changed the title question about one-time jobs [feat] removal of one time jobs after worker completes Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants