We have Azure Functions executing stored procedure every 2 seconds. Most of the time 90% of the time the stored procedure will finish in less than 1 second. But if the json is big and have lots of values some times it runs for more than 2 seconds. I don't want the Azure function to start until the one its running is completed.
[FunctionName("OrderOIHSync")]
public static async Task RunSingle([TimerTrigger("*/2 * * * * *")]TimerInfo myTimer, ILogger log)
Is this the right approach or how I can control so in exception cases the azure function don't trigger. Based on documentation timer trigger says singleton but I seen cases where it's triggering and causing some data issues.
Any suggestions appreciated.