Skip to content

Commit

Permalink
Apply old PR 293
Browse files Browse the repository at this point in the history
  • Loading branch information
danhunsaker committed Dec 11, 2018
1 parent 23e641d commit 415eb00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Resque/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function killChild()
}

$this->logger->log(Psr\Log\LogLevel::INFO, 'Killing child at {child}', array('child' => $this->child));
if(exec('ps -o pid,state -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {
if(exec('ps -o pid,s -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {
$this->logger->log(Psr\Log\LogLevel::DEBUG, 'Child {child} found, killing.', array('child' => $this->child));
posix_kill($this->child, SIGKILL);
$this->child = null;
Expand Down Expand Up @@ -471,7 +471,7 @@ public function pruneDeadWorkers()
public function workerPids()
{
$pids = array();
exec('ps -A -o pid,command | grep [r]esque', $cmdOutput);
exec('ps -A -o pid,args | grep [r]esque', $cmdOutput);
foreach($cmdOutput as $line) {
list($pids[],) = explode(' ', trim($line), 2);
}
Expand Down

0 comments on commit 415eb00

Please sign in to comment.