Skip to content

Commit 16f88a6

Browse files
authored
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.
1 parent ab07fda commit 16f88a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Resque/Worker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ public function queues($fetch = true)
311311
*/
312312
private function startup()
313313
{
314+
declare(ticks = 1);
315+
314316
$this->registerSigHandlers();
315317
$this->pruneDeadWorkers();
316318
Resque_Event::trigger('beforeFirstFork', $this);
@@ -349,7 +351,6 @@ private function registerSigHandlers()
349351
return;
350352
}
351353

352-
declare(ticks = 1);
353354
pcntl_signal(SIGTERM, array($this, 'shutDownNow'));
354355
pcntl_signal(SIGINT, array($this, 'shutDownNow'));
355356
pcntl_signal(SIGQUIT, array($this, 'shutdown'));

0 commit comments

Comments
 (0)