Versions Compared
Version | Old Version 1 | New Version 2 |
---|---|---|
Changes made by | Former user |
Former user |
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
@Scheduled
Specifies a scheduled task to run at a certain interval
Info |
---|
|
To summarize the schedule string format:
"minute hour day-of-month month day-of-week"
@OnScheduledFunctionResultUpdate
Used to annotate a function that will be used as a callback function by Helium when there is any update on scheduled function results. The annotation cannot be used in conjunction with other function annotations and the function must take exactly one parameter of type __scheduled_function_result__. Note that this feature will be deployed as part of Helium 1.5. The example below demonstrates the use of this annotation.
Code Block | ||||
---|---|---|---|---|
| ||||
@OnScheduledFunctionResultUpdate
void scheduledFunctionResultUpdateCallback(__scheduled_function_result__ scheduledFunctionResult) {
if(scheduledFunctionResult.success == false) {
FailedScheduledFunction failedScheduledFunction = FailedScheduledFunction:new();
failedScheduledFunction.failureRecordedOn = Mez:now();
failedScheduledFunction.scheduledFunctionResultId = scheduledFunctionResult._id;
failedScheduledFunction.save();
}
} |
Note that duplicating the data from the __scheduled_function_result__ object in the above code snippet is done purely for demonstration purposes. Records from this object can be queried directly without needing to duplicate the data into a custom object.