X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fqueuedaemon.php;h=30a8a9602630e439ca16736d829f25bbb10d6ce8;hb=7931875bbbfb127c0fa2f49331c137f0c6f1824a;hp=bedd14b1a3fbce867534e2c3a0eeb8e4857ce52c;hpb=055a00bcaeaa50c36143bd151bf4433c5c87d174;p=quix0rs-gnu-social.git diff --git a/scripts/queuedaemon.php b/scripts/queuedaemon.php index bedd14b1a3..30a8a96026 100755 --- a/scripts/queuedaemon.php +++ b/scripts/queuedaemon.php @@ -109,13 +109,19 @@ class QueueDaemon extends SpawningDaemon $master = new QueueMaster($this->get_id()); $master->init($this->all); - $master->service(); + try { + $master->service(); + } catch (Exception $e) { + common_log(LOG_ERR, "Unhandled exception: " . $e->getMessage() . ' ' . + str_replace("\n", " ", $e->getTraceAsString())); + return self::EXIT_ERR; + } $this->log(LOG_INFO, 'finished servicing the queue'); $this->log(LOG_INFO, 'terminating normally'); - return true; + return $master->respawn ? self::EXIT_RESTART : self::EXIT_SHUTDOWN; } }