views:

43

answers:

1

The problem: we have jobs that run from a few seconds to a few minutes in BackgroundRB from a Rails app. But, what happens when we deploy new code and restart BackgroundRB when it's performing a task? BackgroundRB does not seem to pick up any 'taken' tasks and I have not been able to find anything that can recover these tasks.

Can anyone tell me if and how BackgroundRB provides for recovering tasks that were running when backgroundrb goes down?

The reason I ask this question is that at the end of the job, a new job is queued in the future at an arbitrary time.

A: 

A possible solution would be to reset all 'taken' jobs when deploy a new application. But what'd be the most logical place to do this? I'm currently thinking a rails initializor.

Ariejan
I would probably do it using capistrano.
jonnii
Yes, putting it in an initializer would pose the problem that all running tasks are reset when Passenger spawns a new Ruby process. Not good! Capistrano would be a better way to go in combination with the after_update_code hook.
Ariejan