Log every failed background job in debug mode
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 2 Jun 2016 20:35:51 +0000 (22:35 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 2 Jun 2016 20:36:19 +0000 (22:36 +0200)
wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php

index 10a53106070a83d41ee20c16d871db76db032f5d..e34a224cd7809939b6d913b838f5ea8b24c040e1 100644 (file)
@@ -100,6 +100,10 @@ class BackgroundQueueHandler extends SingletonFactory {
                        
                        if ($job->getFailures() <= $job::MAX_FAILURES) {
                                $this->enqueueIn($job, $job->retryAfter());
+                               
+                               if (WCF::debugModeIsEnabled()) {
+                                       \wcf\functions\exception\logThrowable($e);
+                               }
                        }
                        else {
                                // job failed too often: log
@@ -112,6 +116,10 @@ class BackgroundQueueHandler extends SingletonFactory {
                        
                        if ($job->getFailures() <= $job::MAX_FAILURES) {
                                $this->enqueueIn($job, $job->retryAfter());
+                               
+                               if (WCF::debugModeIsEnabled()) {
+                                       \wcf\functions\exception\logThrowable($e);
+                               }
                        }
                        else {
                                // job failed too often: log