Reputation: 10939
I'm deploying a Rails app with Capistrano.
This app has some jobs running long time (about 1 up to 3 hours) via Resque.
The jobs are enqueued in the queue via an external process (not cron), I don't know the exact time when the jobs are enqueued.
When I deploy the app, I want the Resque scheduler loads the new Rails environment.
I don't want kill running jobs during the deployment.
Ideally the running processes should finish, and the Resque scheduler should load the new Rails environment, so the next time the job runs, it runs with the updated app.
I know how to monitor / restart processes with monit / supervisor. But not sure about a strategy / timing when shutdown / restart which Resque process.
Any Suggestion ?
Upvotes: 2
Views: 387
Reputation: 252
If you send the QUIT
signal to a Resque worker, it will finish processing the current job and then shut down. See the Signals section of the Resque README.
Once the worker process shuts down, the process supervisor would be able to start a new worker with the updated code.
Upvotes: 1