Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Delayed job stops running

I'm developing this application which I have deployed to OpenShift.

I have "moved" the actual user registration process to a delayed job because there are a lot of stuff taking placing during this. Every two days (or so), the delayed job process stops running.

In the logs I find this:

Error while reserving job: closed MySQL connection

I tried starting it with the following command:

RAILS_ENV=production bin/delayed_job -m start

but the problem still exists.

Any ideas?

like image 637
Lazarus Lazaridis Avatar asked Oct 20 '22 20:10

Lazarus Lazaridis


1 Answers

Try adding this to your database.yml

reconnect: true

I am not sure if this will fix your problem, but its worth trying.

Also, have a look at this MySql documentation about lost connection

like image 181
usha Avatar answered Nov 03 '22 07:11

usha