[Backgroundrb-devel] Deploying to production with backgroundrb (capistrano)

Jerrod Blavos jerrod at indierockmedia.com
Mon Feb 5 13:48:14 EST 2007


I have noticed that occasionally (about 50% of the time) when i  
deploy (using capistrano) my app to a production server, i have to  
ssh into the box and manually
stop and start backgroundrb to get it to load my workers.

  this is my basic setup

i have 2 workers:

lib/workers/mp3_worker.rb  => takes a hash of params to downsample an  
mp3
lib/workers/flv_worker.rb  =>  takes a has of arguments to compose a  
command line to convert a file into flv

in my recipe
config/deploy.rb

  i have 2 lines
   run "#{current_path}/script/backgroundrb stop"
   run "#{current_path}/script/backgroundrb start"

that should stop the server and restart it.

  after the deploy, i have started sshing in tot he box and running

script/backgroundrb console

and checking the loaded_worker_classes

about 50% of the time, its empty. no classes loaded.

if i manually run those commands, it starts and they load.  identical  
command. different (and upredictable) results.

how would i go about ensuring that when i deploy that backgroundrb  
restarts properly?  ideally i will only be restarting backgroundrb  
when i have model changes or worker class changes that would affect  
it's operation.


Jerrod Blavos
ph. 919.341.0143
fx.  482.492.5009
jerrod at indierockmedia.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070205/1463d282/attachment-0001.html 


More information about the Backgroundrb-devel mailing list