Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyCyborg committed Dec 9, 2019
1 parent 2ebbc61 commit 71c4d6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Console/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
{
$path = storage_path('queue.pid');

if (is_readable($path) && ! empty($pid = (int) file_get_contents($path))) {
$command = sprintf("ps -p %d --no-heading | awk '{print $1}'", $pid);
if (is_readable($path) && ! empty($result = file_get_contents($path))) {
$command = sprintf("ps -p %d --no-heading | awk '{print $1}'", $pid = (int) $result);

if (! empty($result = (int) exec($command)) && ($result == $pid)) {
if (! empty($result = exec($command)) && ($pid == (int) $result)) {
return;
}
}

$command = sprintf('%s %s queue:work --daemon --tries=3 >/dev/null & echo $!', PHP_BINARY, base_path('forge'));

// Store the Queue Worker PID for later checking.
file_put_contents($path, (int) exec($command));
file_put_contents($path, exec($command));

})->describe('Monitor the Queue Worker execution');

Expand Down

0 comments on commit 71c4d6b

Please sign in to comment.