Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Last active August 29, 2015 13:58
Show Gist options
  • Save mikecmpbll/9975038 to your computer and use it in GitHub Desktop.
Save mikecmpbll/9975038 to your computer and use it in GitHub Desktop.
delayed_job deletion
class AlertJob < Struct.new(:event_id, :user_id, :db)
def perform
# ...
end
def display_name
"AlertJob-#{event_id}-#{user_id}-#{db}"
end
end
Delayed::Job.all.each do |j|
if j.name == "AlertJob-#{id}-#{user_id}-#{get_db_name}"
j.destroy
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment