Skip to content

Commit a84812f

Browse files
even better: test for functionality, not OS, before forking
1 parent 9415524 commit a84812f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Resque/Worker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ public function work($interval = 5)
186186

187187
$this->child = Resque::fork();
188188

189-
// Forked and we're the child. Or this is Windows. Run the job.
190-
if ($this->child === 0 || $this->child === false || strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
189+
// Forked and we're the child. Or PCNTL is not installed. Run the job.
190+
if ($this->child === 0 || $this->child === false || !function_exists('pcntl_fork')) {
191191
$status = 'Processing ' . $job->queue . ' since ' . strftime('%F %T');
192192
$this->updateProcLine($status);
193193
$this->log($status, self::LOG_VERBOSE);

0 commit comments

Comments
 (0)