Last active
August 29, 2015 13:58
-
-
Save mikecmpbll/9975038 to your computer and use it in GitHub Desktop.
delayed_job deletion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AlertJob < Struct.new(:event_id, :user_id, :db) | |
def perform | |
# ... | |
end | |
def display_name | |
"AlertJob-#{event_id}-#{user_id}-#{db}" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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