I think I need some clarification on something.
when I run artisan queue:listen manually, it stays alive fine. but when I have PM2 run it, it keep restarting.
I have a config file that contains the following
{
// Application #2
"name": "artisan-queue-listen",
"script": "artisan",
"args": ["queue:listen", "--tries=1", "--sleep=1", "--timeout=120"],
"exec_interpreter": "php",
"exec_mode" : "fork_mode",
"watch": false,
"merge_logs": true,
"cwd": "/base/path/to/script/",
}
and that's what I use to keep it alive.
Am I missing something?
Is there any logs ? (PM2 and the application) ?
Odd, this now works:
{
// Application #2
"name": "artisan-queue-listen",
"script": "artisan",
"args": ["queue:listen", "--tries=1", "--sleep=1", "--timeout=120"],
"exec_interpreter": "php",
"exec_mode" : "fork_mode",
"max_memory_restart" : "1G",
"watch": false,
"merge_logs": true,
"cwd": "/base/path/to/script/",
}
It must have been the max_memory_restart? does PM2 have a default value for this?
ok found the issue. Little known fact. watch:true watches everything under cwd so basically, even log file changes are considered file changes. will need to add exclusions specific to Laravel in this instance.
Most helpful comment
Odd, this now works:
It must have been the max_memory_restart? does PM2 have a default value for this?