Skip to content

Instantly share code, notes, and snippets.

@sephraim
Last active March 8, 2023 21:20
Show Gist options
  • Save sephraim/e1da7f3070518311ecab27cb89a78f6f to your computer and use it in GitHub Desktop.
Save sephraim/e1da7f3070518311ecab27cb89a78f6f to your computer and use it in GitHub Desktop.
[DelayedJob / ActiveJob useful commands]

Delayed Job

Check number of queued jobs

Delayed::Job.count

Delete the first job

Delayed::Job.first.destroy

Run a specific job now

# Immediately runs the MyCoolThingJob.perform method
MyCoolThingJob.perform_now

Queue a specific job for later

# Queue the MyCoolThingJob.perform method to run later
MyCoolThingJob.perform_later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment