Skip to content

Instantly share code, notes, and snippets.

@ckozus
Created August 8, 2018 20:05
Show Gist options
  • Save ckozus/c378b2efa0d59cd251f43c81b76d7860 to your computer and use it in GitHub Desktop.
Save ckozus/c378b2efa0d59cd251f43c81b76d7860 to your computer and use it in GitHub Desktop.
def submitted?(klass)
found = false
queue = Sidekiq::Queue.new(ENV.fetch('LISTINGS_QUEUE'))
queue.each do |job|
job_class = job.args.first['job_class']
job_argument = job.args.first['arguments'].first
job_event_id = job_argument.try(:to_i)
if job_class == klass.to_s && job_event_id == @event.id
found = true
break
end
end
found
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment