Improved the wording of the cronjob error message
authorAlexander Ebert <ebert@woltlab.com>
Wed, 30 Sep 2020 18:39:39 +0000 (20:39 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 30 Sep 2020 18:39:39 +0000 (20:39 +0200)
wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php

index 863339baa010acedc6b37cd0f2b841fa191cce54..82e065d50a3c54067e650aee657305421f998f1c 100644 (file)
@@ -148,7 +148,9 @@ class CronjobScheduler extends SingletonFactory {
                                                        'execTime' => TIME_NOW
                                                ]);
                                                $logEditor = new CronjobLogEditor($log);
-                                               $this->logResult($logEditor, new \Exception("Cronjob stuck in state '".$cronjob->state."' for two periods (nextExec '".$cronjob->nextExec."', afterNextExec '".$cronjob->afterNextExec."', now '".TIME_NOW."')."));
+                                               
+                                               $errorMessage = sprintf("The cronjob '%s' (ID %d) appears to have failed. (nextExec %d, afterNextExec %d, now %d)", $cronjob->cronjobID, $cronjob->cronjobName, $cronjob->nextExec, $cronjob->afterNextExec, TIME_NOW);
+                                               $this->logResult($logEditor, new \Exception($errorMessage));
                                                break;
                                        default:
                                                throw new \LogicException('Unreachable');