Skip to content

Instantly share code, notes, and snippets.

@zedtux
Last active June 27, 2019 21:02
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 zedtux/d94b6d30dcf4ef30ca79d8b553418627 to your computer and use it in GitHub Desktop.
Save zedtux/d94b6d30dcf4ef30ca79d8b553418627 to your computer and use it in GitHub Desktop.
Overrides of the Sidekiq method to delete a job, transmit via ActionCable to the UI
require 'sidekiq/api'
module Sidekiq
class JobSet < SortedSet
alias :old_delete_by_value :delete_by_value
def delete_by_value(name, value)
parsed = JSON.parse(value)
CommisChannel::BackgroundTasks.broadcast_delete(parsed['jid'])
old_delete_by_value(name, value)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment