TimerInfo has null ScheduleStatus if the interval is less than a minute
See original GitHub issueI was debugging my TimerTrigger function with a TimeSpan string of “00:00:10”, and I was getting null reference exceptions when accessing TimerInfo.ScheduleStatus. Bumped it up to “00:01:00” and everything started working.
Repro steps
- Add a function to your WebJob, like
public void TestFunction([TimerTrigger("00:00:59", RunOnStartup = true, UseMonitor = true)] TimerInfo timer)
-
Run WebJob, notice that when
TestFunction()
is called,timer.ScheduleStatus
is null. -
Change TimeSpan string to
"00:01:00"
, notice issue is resolved.
Expected behavior
timer.ScheduleStatus
is set.
Actual behavior
timer.ScheduleStatus
is null.
Related information
- Tried .NET 4.7 and 4.6.2
- WebJobs and WebJobs.Extensions 2.2.0
- I was able to reproduce the problem in a new project with no other code.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:7 (3 by maintainers)
Top Results From Across the Web
What are the specifics of the TimerInfo class in an azure ...
If it did miss any it immediately executes your function and passes IsPastDue as true. Then it continues to execute on the regular...
Read more >Timer trigger for Azure Functions
If not set explicitly, the default is true for schedules that have a recurrence interval greater than or equal to 1 minute. For...
Read more >Azure Functions error handling and retry guidance
Learn how to handle errors and retry events in Azure Functions, with links to specific binding errors, including information on retry ...
Read more >Understanding TimerTriggers in Azure Functions
The timer has an interval setting based on the NCronTab notation. This is a dialect of the popular CRON notation as seen in...
Read more >Azure Functions – Timer
The labs contained in this article show how to create, configure, code and monitor an Azure Function with a Timer.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on this?
I came across this same problem.
ScheduleStatus
was null because I was using a 30 sec timer, but as soon as I raised it to 60 seconds the problem was resolved.This 1 minute cutoff logic feels quite arbitrary and confusing. I would expect
ScheduleStatus
to be always populated.What I really need though, is the time that my function last run succesfully, not just when it was last run regardless of outcome (success or failure).