Index: class.tx_scheduler_task.php
===================================================================
--- class.tx_scheduler_task.php (revision 1114)
+++ class.tx_scheduler_task.php (working copy)
@@ -121,8 +121,9 @@
* It MUST be implemented by all classes inheriting from this one
* Note that there is no error handling, errors and failures are expected
* to be handled and logged by the client implementations.
+ * Should return true on successful execution, false on error.
*
- * @return void
+ * @return boolean Returns true on successful execution, false on error
*/
abstract public function execute();
@@ -427,10 +428,11 @@
/**
* Removes given execution from list
*
- * @param integer $executionID: id of the execution to remove
+ * @param integer Id of the execution to remove.
+ * @param boolean Status of the last execution, true for success, false to represent an error.
* @return void
*/
- public function unmarkExecution($executionID) {
+ public function unmarkExecution($executionID, $successfullyExecuted = false) {
// Get the executions for the task
$queryArr = array(
'SELECT' => 'serialized_executions',
@@ -456,7 +458,10 @@
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'tx_scheduler_task',
'uid = ' . intval($this->taskUid),
- array('serialized_executions' => $runningExecutionsSerialized)
+ array(
+ 'serialized_executions' => $runningExecutionsSerialized,
+ 'lastexecution_success' => (int) $successfullyExecuted
+ )
);
}
}
Index: mod1/index.php
===================================================================
--- mod1/index.php (revision 1115)
+++ mod1/index.php (working copy)
@@ -860,6 +860,11 @@
$executionStatus = 'disabled';
}
+ // a failure is the worst thing that could happen, so it must overwrite all other statuses
+ if (!empty($schedulerRecord['lastexecution_time']) && !$schedulerRecord['lastexecution_success']) {
+ $executionStatus = 'failure';
+ }
+
// formatting the execution status
$executionStatus = '';
@@ -889,10 +894,11 @@
$content .= '