Skip to content

Instantly share code, notes, and snippets.

@smostovoy
Created December 11, 2012 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smostovoy/4255780 to your computer and use it in GitHub Desktop.
Save smostovoy/4255780 to your computer and use it in GitHub Desktop.
script for direct puting job into queue(sidekiq) w/o loading rails
#!/usr/bin/env ruby
begin
require 'sidekiq'
require 'honeybadger'
require File.expand_path(File.dirname(__FILE__)+"/../app/workers/base_worker")
Dir[File.dirname(__FILE__)+"/../app/workers/**/**"].each {|file| require File.expand_path(File.dirname(__FILE__)+file) }
worker = ARGV[0]
arg = ARGV[1]
if arg
p Object.const_get(worker).perform_async(arg)
else
p Object.const_get(worker).perform_async()
end
rescue =>e
Honeybadger.configure do |config|
config.api_key = 'some key'
config.environment_name = ENV["RAILS_ENV"]
config.ignore_only = []
end
Honeybadger.notify_or_ignore(e, {
:component => 'queue.rb',
:parameters => {args: ARGV}
})
p e.message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment