Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 64 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. include Sidekiq::Worker
  2. include Sidekiq::Status::Worker
  3.  
  4. sidekiq_options queue: :flight_parser, backtrace: true, retry: 3
  5.  
  6. def expiration
  7.    @expiration ||= 60*60*24*30 # 30 days
  8. end
  9.  
  10. def update_progress_status
  11.    at @status, status_message
  12.    @status += @step
  13. end
  14.  
  15. def set_progress_status_and_step(num_of_elements)
  16.    @step = calculate_progress_step(num_of_elements)
  17.    @status = @step
  18. end
  19.    
  20. require 'sidekiq'
  21. require 'sidekiq-status'
  22.  
  23. Sidekiq.configure_client do |config|
  24.   config.redis = { :size => 1 }
  25.   # accepts :expiration (optional)
  26.   Sidekiq::Status.configure_client_middleware config, expiration: 30.minutes
  27.  
  28. end
  29.  
  30. Sidekiq.configure_server do |config|
  31.   # accepts :expiration (optional)
  32.   Sidekiq::Status.configure_server_middleware config, expiration: 30.minutes
  33.  
  34.   # accepts :expiration (optional)
  35.   Sidekiq::Status.configure_client_middleware config, expiration: 30.minutes
  36.  
  37. end
  38.    
  39. Redis.current = Redis.new(:host => '127.0.0.1', :port => 6379)
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