Does the function extension use the azure storage to save the last
time the function triggered and compare that to the current execution
time to see if it missed an execution and set IsPastDue to true?
The default value of the IsPastDue is false.
public TimerInfo(TimerSchedule schedule, ScheduleStatus status, bool isPastDue = false)
{
Schedule = schedule;
ScheduleStatus = status;
IsPastDue = isPastDue;
}
Will IsPastDue be set to true if the function triggers a few seconds
or milliseconds late or only if it missed an execution completely?
If the schedule is past due, this value will be true.
Is ScheduleStatus.Last the last time it triggered or is that just
computed based on the cron expression?
The value is obtained from DateTime.Now(The time you execute last time.), not computed based on the cron expression.
What is ScheduleStatus.LastUpdated is that the last time I changed the
cron expression?
This value is obtained from the as same value as ScheduleStatus.Last:
ScheduleStatus = new ScheduleStatus
{
Last = adjustedInvocationTime,
Next = _schedule.GetNextOccurrence(adjustedInvocationTime),
LastUpdated = adjustedInvocationTime
};
What is Schedule.GetNextOccurrence does that return same thing as
ScheduleStatus.Next if I pass DateTime.Now
Because ScheduleStatus is instantiated by the value provided by Schedule.GetNextOccurrence.
The source code:
https://github.com/Azure/azure-webjobs-sdk-extensions/blob/a3a5a49a64f3592c1eb7c1296086dc83c2011e96/src/WebJobs.Extensions/Extensions/Timers/TimerInfo.cs
https://github.com/Azure/azure-webjobs-sdk-extensions/blob/a3a5a49a64f3592c1eb7c1296086dc83c2011e96/src/WebJobs.Extensions/Extensions/Timers/Listener/TimerListener.cs
Please have a look.