question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TimerInfo has null ScheduleStatus if the interval is less than a minute

See original GitHub issue

I 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

  1. Add a function to your WebJob, like
public void TestFunction([TimerTrigger("00:00:59", RunOnStartup = true, UseMonitor = true)] TimerInfo timer)
  1. Run WebJob, notice that when TestFunction() is called, timer.ScheduleStatus is null.

  2. 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:open
  • Created 5 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
davidferro91commented, Oct 15, 2021

Any update on this?

2reactions
merfolkcommented, Mar 21, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found