You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

enqueue.rb 591B

12345678910111213141516171819202122
  1. #!/usr/bin/env ruby
  2. ENV['RAILS_ENV'] ||= 'development'
  3. require 'dotenv'
  4. Dotenv.load ".env.#{ENV['RAILS_ENV']}", '.env'
  5. if ENV['RAILS_ENV'] == 'development'
  6. DIR = File.dirname File.dirname File.expand_path __FILE__
  7. require File.join DIR, 'config/environment'
  8. ENV['RAILS_ENV'] = 'test'
  9. require 'sidekiq/testing/inline'
  10. end
  11. require 'sidekiq'
  12. options = {
  13. url: ENV['REDIS_URL'],
  14. namespace: :cryptcheck
  15. }
  16. client = Sidekiq::Client.new Sidekiq::RedisConnection.create options
  17. clazz, *args = ARGV
  18. clazz += 'Worker'
  19. client.push({ 'class' => clazz, 'args' => args })