C
C#9mo ago
127001

Time Triggered Azure Function | NextStatus is same with current time

I have created my first TimerTrigger Azure Function . Which is built in template and run it to test locally.
[2024-03-28T17:02:00.016Z] Executing 'Functions.Function1' (Reason='Timer fired at 2024-03-28T19:02:00.0162712+02:00', Id=1aa0e694-47fa-44a1-9cde-e812190e4978) [2024-03-28T17:02:00.025Z] C# Timer trigger function executed at: 28/03/2024 19:02:00 [2024-03-28T17:02:00.027Z] Next timer schedule at: 28/03/2024 19:02:00 [2024-03-28T17:02:00.032Z] Executed 'Functions.Function1' (Succeeded, Id=1aa0e694-47fa-44a1-9cde-e812190e4978, Duration=16ms)
I got this output. What I don't understand is why Next timer schedule at: 28/03/2024 19:02:00 is same with current one. Even though trigger is working every minute, there is no problem with that
[Function("Function1")]
public void Run([TimerTrigger("0 */1 * * * *")] TimerInfo myTimer)
{
_logger.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");

if (myTimer.ScheduleStatus is not null)
{
_logger.LogInformation($"Next timer schedule at: {myTimer.ScheduleStatus.Next}");
}
}
[Function("Function1")]
public void Run([TimerTrigger("0 */1 * * * *")] TimerInfo myTimer)
{
_logger.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");

if (myTimer.ScheduleStatus is not null)
{
_logger.LogInformation($"Next timer schedule at: {myTimer.ScheduleStatus.Next}");
}
}
1 Reply
lycian
lycian9mo ago
I don't know too much about how functions handles stuff, but a few considerations: 1. Did it actually run twice in between minutes? 2. Is IsPastDue true? That could mean execution happened late on the current
Want results from more Discord servers?
Add your server