Implemented dtdesign's suggestions
authorTim Düsterhus <timwolla@arcor.de>
Mon, 22 Aug 2011 15:07:14 +0000 (17:07 +0200)
committerTim Düsterhus <timwolla@arcor.de>
Mon, 22 Aug 2011 15:09:51 +0000 (17:09 +0200)
wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php

index c351702843a8e7f9a30c826cab61e299d9e3fc8d..4692331d12a096d8539bdbb1f93c427959a61848 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\data\cronjob;
 use wcf\data\AbstractDatabaseObjectAction;
+use wcf\data\cronjob\log\CronjobLogEditor;
 use wcf\system\WCF;
 use wcf\util\DateUtil;
 
@@ -115,20 +116,18 @@ class CronjobAction extends AbstractDatabaseObjectAction {
                        $executable = new $className();
                        
                        // execute cronjob
-                       $success = true;
                        $error = '';
                        try {
                                $executable->execute(new Cronjob($cronjob->cronjobID));
                        }
                        catch (\Exception $e) {
-                               $success = false;
-                               $error = (string) $e;
+                               $error = $e->getMessage();
                        }
                        
-                       log\CronjobLogEditor::create(array(
+                       CronjobLogEditor::create(array(
                                'cronjobID' => $cronjob->cronjobID,
                                'execTime' => TIME_NOW,
-                               'success' => (int) $success,
+                               'success' => (int) ($error != ''),
                                'error' => $error
                        ));