SHARE
TWEET

Untitled

a guest Jul 17th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tiles.each{ |args|
  2.   CrawlWorker.perform_async(args)
  3.      
  4. CrawlWorker.cancel!(jid)
  5.      
  6. def cancelled?
  7.   Sidekiq.redis {|c| c.exists("cancelled-#{jid}") }
  8. end
  9.  
  10. def self.cancel!(jid)=
  11.   Sidekiq.redis {|c| c.setex("cancelled-#{jid}", 86400, 1) }
  12. end
  13.  
  14. def perform(args)
  15.   return if cancelled?
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top