Skip to content

Commit 896a4d4

Browse files
committed
消除在sae上的warning
1 parent e453499 commit 896a4d4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/Resque/Worker.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,12 @@ public function pruneDeadWorkers()
454454
public function workerPids()
455455
{
456456
$pids = array();
457-
exec('ps -A -o pid,command | grep [r]esque', $cmdOutput);
458-
foreach($cmdOutput as $line) {
459-
list($pids[],) = explode(' ', trim($line), 2);
460-
}
457+
@exec('ps -A -o pid,command | grep [r]esque', $cmdOutput);
458+
if ($cmdOutput) {
459+
foreach($cmdOutput as $line) {
460+
list($pids[],) = explode(' ', trim($line), 2);
461+
}
462+
}
461463
return $pids;
462464
}
463465

0 commit comments

Comments
 (0)