Skip to content

Timer trigger not fired on the schedule if function execution takes longer than the specified schedule. #556

@safihamid

Description

@safihamid

Created a timer trigger function with the schedule of 1 minute and the body of the function had a CPU intensive operation taking 2 minutes to complete.

The function was being called on a random schedule longer than 2 minutes.

If this is by design because timers run singleton then we should document this.

Here was my function:
using System;

public static void Run(TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
DateTime now = DateTime.Now;

  int k = 1;
  int seconds = 120;

    while (DateTime.Now.Subtract(now) < TimeSpan.FromSeconds(seconds))
    {
        for (int i = 0; i < 1000; i++)
        {
                k += i ;
        }
    }

log.Info($"C# Timer trigger finished function execution at: {DateTime.Now}");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions