aboutsummaryrefslogtreecommitdiff
path: root/src/phinde/Queue.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/phinde/Queue.php')
-rw-r--r--src/phinde/Queue.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/phinde/Queue.php b/src/phinde/Queue.php
index 1033d7a..a8ead3d 100644
--- a/src/phinde/Queue.php
+++ b/src/phinde/Queue.php
@@ -43,10 +43,14 @@ class Queue
$cmd = 'gearadmin --status'
. '| grep ' . escapeshellarg($this->queueName);
$line = exec($cmd);
-
- $parts = preg_split('#\s+#', $line);
- if (count($parts) !== 4) {
- throw new \Exception('gearadmin status line does not have 4 parts');
+ if ($line === '') {
+ //job not registered
+ $parts = [0, -1, -1, -1];
+ } else {
+ $parts = preg_split('#\s+#', $line);
+ if (count($parts) !== 4) {
+ throw new \Exception('gearadmin status line does not have 4 parts');
+ }
}
return array(