Created
August 8, 2018 20:05
-
-
Save ckozus/c378b2efa0d59cd251f43c81b76d7860 to your computer and use it in GitHub Desktop.
This file contains 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
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