Skip to content

Instantly share code, notes, and snippets.

@sauloperez
Created October 25, 2017 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sauloperez/fe464cf3505b6e24d566196803ff7c16 to your computer and use it in GitHub Desktop.
Save sauloperez/fe464cf3505b6e24d566196803ff7c16 to your computer and use it in GitHub Desktop.
Snippets to check Delayed Job data
# Failed
Delayed::Job.where('failed_at IS NOT NULL')
# Active
Delayed::Job.where('failed_at IS NULL AND locked_by IS NOT NULL')
# Queued
Delayed::Job.where('failed_at IS NULL AND locked_by IS NULL')
# Destroy
Delayed::Job.find(id).destroy
# Retry
dj = Delayed::Job.find(id)
dj.update_attribute :failed_at, nil if dj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment