Skip to content

Commit 74041d6

Browse files
committed
remove signal handlers if pcntl missing
1 parent 6881501 commit 74041d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

commands/AsyncWorkerCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ protected function processTask(AsyncTask $task)
6060

6161
private function handleSignal()
6262
{
63+
if (!function_exists('pcntl_signal')) {
64+
return;
65+
}
66+
6367
pcntl_signal(
6468
SIGTERM,
6569
function ($signo) {
@@ -71,11 +75,19 @@ function ($signo) {
7175

7276
private function removeSignalHandler()
7377
{
78+
if (!function_exists('pcntl_signal')) {
79+
return;
80+
}
81+
7482
pcntl_signal(SIGTERM, SIG_DFL);
7583
}
7684

7785
private function checkSignal()
7886
{
87+
if (!function_exists('pcntl_signal')) {
88+
return false;
89+
}
90+
7991
pcntl_signal_dispatch();
8092
if (AsyncWorkerCommand::$state == -1) {
8193
return true;

0 commit comments

Comments
 (0)