aboutsummaryrefslogtreecommitdiff
path: root/src/phinde
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-12-03 22:32:08 +0100
committerChristian Weiske <cweiske@cweiske.de>2016-12-03 22:32:08 +0100
commit6c95d7fe170a54449755a8b571a191a3aaaf954e (patch)
treed961cbb6ad70c015a7761805a8c4a111685d81aa /src/phinde
parentcbefad7ddd4927b1bbe225fec540a082c15f5403 (diff)
downloadphinde-6c95d7fe170a54449755a8b571a191a3aaaf954e.tar.gz
phinde-6c95d7fe170a54449755a8b571a191a3aaaf954e.zip
Do not crash status page when gearman worker is not registered
Diffstat (limited to 'src/phinde')
-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(