I made a Laravel app that uses the queue system (via database) to send emails. These emails are Job instances and are pushed to the queue after a cron-job is complete every 3 minutes or so.
If I run the artisan command
/path_to_php/7.1/bin/php artisan queue:work --queue=emails_1--tries=2 --daemon
in the terminal via SSH, it starts processing the jobs and sending emails. Obviously I would like to run this command and exit the terminal with it still running so I used the "nohup" approach.
nohup /path_to_php/7.1/bin/php artisan queue:work --queue=emails_1--tries=2 --daemon > storage/logs/laravel.log &
After running this I get a PDOException:
PDOException: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction in ...
I'm not really familiar with this error as I've never encountered something like this before but why can't I run the queue work command using nohup but can run it without problems without nohup? Any ideas as to why this is happening ? I'm using Laravel 5.2.
Please enlighten me. Thanks a lot.