Closed rafi16d closed 7 years ago
You have to manually disconnect the CakePHP MySQL connection after a successful job. The problem is, that you're running into the wait_timeout
of MySQL after 8h by default. CakePHP doesn't know that the connection died.
Use sth like
$worker->attachListener('Worker.job.success', function ($event) {
ConnectionManager::get('default')->disconnect();
});
in a custom QueuesadillaShell
class
@cleptric docs pull request? You can also attach using the global event manager in a config/events.php
that is only attached in the cli context?
Hello
I'm using queuesadilla to send SMS and Email from a web interface. When the user send a message in the web interface, the recipients are saved in a database with a "_disturbanceid" and a job was created with the same "_disturbanceid".
The job call the method
processSendEmail()
with the "_disturbanceid" as agument. I'm using this id to find all the recipient.It's working, but I have an error when the worker was running for a long time.
After few hour, the worker continue to display
Debug: No job!
and when a new job was added he display this error :I'm using MysqlEngine and the connection is set to
'persistent' => false
.It seems happend when I'm doing a query in the job method that is called by queuesadilla :
Maybe I was going in the wrong way, what would be the best way to do this ?
Sorry for my english, I'm from Switzerland :)