Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions Timer Trigger Scale-out

If i have an Azure Function which runs on a timer trigger every 5 minutes, what happens if one run takes more than 5 minutes?

Will the next timer trigger kick off, regardless of any currently executing triggers?

Reason i ask: I need to ensure only 1 Azure Function is running at a time (yes, i know this kind of goes against the concept of functions). If one run takes < 5 minutes (most of the time it should), great - kick off next one at the next 5 minute window. If it doesn't finish, don't kick off.

I'd prefer to use Azure Functions, but in this case - should i just not bother and simply use a continuously running Azure WebJob instead?

Thanks!

like image 768
RPM1984 Avatar asked Feb 06 '23 00:02

RPM1984


1 Answers

As described in the TimerTrigger wiki page:

If your function execution takes longer than the timer interval, another execution won't be triggered until after the current invocation completes. The next execution is scheduled after the current execution completes.

So you should be getting the behavior you're looking for already - only a single function invocation running at any given time.

like image 128
mathewc Avatar answered Mar 29 '23 05:03

mathewc