Status/Resolution/Reason: Closed/Fixed/BugReVerified
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 11/17/2014
Components: Scheduler
Versions: 2016,11.0
Failure Type: Data Corruption
Found In Build/Fixed In Build: CF11_Final / docs
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Issues:
1) Currently, when a task w/ a handler triggers, scheduler doesn't create an _instance_ of the handler before calling its methods.
2) <cfschedule action="list" returns LAST_FIRE as the last time the task triggered, but multiple instances of the task could be running simultaneously.
3) What if, within the handler's onTaskEnd() or onError(), developer wants to know how long _this instance_ of the task ran?
Well, if scheduler created a handler _instance_ each time the task triggered, then we could do this:
component implements="cfide.scheduler.ITaskEventHandler" {
boolean function onTaskStart(struct context) {variables.taskStartedAt=now(); return true;}
void function onMisfire(struct context) {}
void function onTaskEnd(struct context) {//use variables.taskStartedAt to determine duration b/c task's last_fire may not be the timestamp of when _this_ instance of the task began running}
void function onError(struct context) {}
void function execute(struct context) {}
}
Meaning, we could create a timestamp in onTaskStart() and access it in onTaskEnd()/onError().
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3852672
Reason: BugVerified
External Customer Info:
External Company:
External Customer Name: itisdesign
External Customer Email:
Attachments:
Comments: