Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Sidekiq, Capistrano,Sinatra for deploys

As part of a capistrano deploy with Sinatra:

* executing `sidekiq:start'
* executing "cd /var/www/nodes/current ; nohup bundle exec sidekiq -e production -C /var/www/nodes/current/config/sidekiq.yml -P /var/www/nodes/current/tmp/pids/sidekiq.pid -r /var/www/nodes/current/app/nodes.rb >> /var/www/nodes/current/log/sidekiq.log 2>&1 &"

I cannot see anyway to get the -r (require) to point to my Sinatra as per sidekiq/issues/10 . The app lives in ./app/nodes.rb.

my config.ru is

require './app/nodes'
run Nodes 
map '/sidekiq' do
    run Sidekiq::Web
end

'./app/nodes' loads in all the environment both nodes and sidekiq needs to run.

In sidekiq/capistrano.rb there is currently no option to pass in an -r flag.

sidekiq.log reports this error, as expected:

2012-10-12T01:04:59Z 8175 TID-bf65s INFO:                  
2012-10-12T01:04:59Z 8175 TID-bf65s INFO:   Please point sidekiq to a Rails 3 application or a Ruby file
2012-10-12T01:04:59Z 8175 TID-bf65s INFO:   to load your worker classes with -r [DIR|FILE].
2012-10-12T01:04:59Z 8175 TID-bf65s INFO: 

Any ideas?

V

like image 519
Vinny Glennon Avatar asked Nov 03 '22 14:11

Vinny Glennon


1 Answers

Resolved by Mike Perham, creator of Sidekiq: on github. In the sidekiq.yml, you can add a specific require option. Thanks very much!

like image 156
Vinny Glennon Avatar answered Nov 10 '22 15:11

Vinny Glennon