mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-22 00:11:53 +00:00
Move declare(ticks = 1) to startup
Having declare(ticks = 1) inside registerSigHandlers() worked perfectly on PHP 5.6 but it doesn't on PHP 7. I found it that moving the declare(ticks = 1) outside registerSigHandlers() solves the issue.
This commit is contained in:
parent
ab07fda51c
commit
16f88a6a38
@ -311,6 +311,8 @@ class Resque_Worker
|
|||||||
*/
|
*/
|
||||||
private function startup()
|
private function startup()
|
||||||
{
|
{
|
||||||
|
declare(ticks = 1);
|
||||||
|
|
||||||
$this->registerSigHandlers();
|
$this->registerSigHandlers();
|
||||||
$this->pruneDeadWorkers();
|
$this->pruneDeadWorkers();
|
||||||
Resque_Event::trigger('beforeFirstFork', $this);
|
Resque_Event::trigger('beforeFirstFork', $this);
|
||||||
@ -349,7 +351,6 @@ class Resque_Worker
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare(ticks = 1);
|
|
||||||
pcntl_signal(SIGTERM, array($this, 'shutDownNow'));
|
pcntl_signal(SIGTERM, array($this, 'shutDownNow'));
|
||||||
pcntl_signal(SIGINT, array($this, 'shutDownNow'));
|
pcntl_signal(SIGINT, array($this, 'shutDownNow'));
|
||||||
pcntl_signal(SIGQUIT, array($this, 'shutdown'));
|
pcntl_signal(SIGQUIT, array($this, 'shutdown'));
|
||||||
|
Loading…
Reference in New Issue
Block a user