Skip to content

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

Closed

Description

@hdrodel

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?

Activity

  1. shadowgate15 commented on Jun 2, 2021

    @shadowgate15
    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.

  2. shadowgate15 commented on Jul 10, 2021

    @shadowgate15
    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.

  3. added
    enhancementNew feature or request
    and removed
    questionFurther information is requested
    on Jul 10, 2021
  4. changed the title [-]question about one-time jobs[/-] [+][feat] removal of one time jobs after worker completes[/+] on Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions