diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-04-13 15:21:18 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-04-13 15:21:18 +0300 |
commit | b3db543c43410fb5199000aed1ab61ba95d85536 (patch) | |
tree | a5b5ffec7b671bab9356180ca1508e95bb75b595 | |
parent | a788befa6b4a149cc168af9c2c8034fc22090cf9 (diff) |
-rw-r--r-- | src/classes/Job.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/classes/Job.php b/src/classes/Job.php index 56052cb..21ed1f0 100644 --- a/src/classes/Job.php +++ b/src/classes/Job.php @@ -51,9 +51,11 @@ abstract class Job extends model { public function __construct(array $raw) { parent::__construct($raw); - pcntl_async_signals(true); - pcntl_signal(SIGTERM, [$this, 'signalHandler']); - pcntl_signal(SIGINT, [$this, 'signalHandler']); + if (PHP_SAPI === 'cli') { + pcntl_async_signals(true); + pcntl_signal(SIGTERM, [$this, 'signalHandler']); + pcntl_signal(SIGINT, [$this, 'signalHandler']); + } } protected function signalHandler(int $signal) {} |