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

Cleanup Remind Job Queue #25

Open
KayvanMazaheri opened this issue Mar 25, 2017 · 0 comments
Open

Cleanup Remind Job Queue #25

KayvanMazaheri opened this issue Mar 25, 2017 · 0 comments
Assignees

Comments

@KayvanMazaheri
Copy link
Owner

Remove completed jobs to free up space on Redis.

Read about job cleanup on Kue's repo.

  • Method 1
queue.create( ... ).removeOnComplete( true ).save()
  • Method 2
kue.Job.rangeByState( 'complete', 0, n, 'asc', function( err, jobs ) {
  jobs.forEach( function( job ) {
    job.remove( function(){
      console.log( 'removed ', job.id );
    });
  });
});

Note that you should provide enough time for .remove calls on each job object to complete before your process exits, or job indexes will leak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant