worker is not restarting when error happens (Windows)
When error throws in worker - it not restarting (Windows). To reproduce - declare this callback and run in daemon mode:
// Emitted when worker starts
$ws_worker->onWorkerStart = function () {
notExistedFunction();
};
It will throw an error and finish service at all, but auto restart is expected
Workman does not support this feature under Windows. Please use Linux system. Or you can try to use similar codes to monitor the process
$cmd = 'php start.php';
function popen_processes($cmd)
{
$descriptorspec = [STDIN, STDOUT, STDOUT];
$resource = proc_open($cmd, $descriptorspec, $pipes);
if (!$resource) {
exit("Can not execute $cmd\r\n");
}
return $resource;
}
$resource = popen_processes($cmd);
while (1) {
sleep(1);
$status = proc_get_status($resource);
if (!$status['running']) {
proc_close($resource);
$resource = popen_processes($process_files);
}
}
Thank you for your reply. This issue was happens when I migrate from Workeman ver (3.5.6) to this version (4.1.3). In version 3.5.6 this feature was worked perfectly. Do you remove support this feature?
Do you remove support this feature?
Yes, this feature removed