Azure Function timerTrigger singleton across more than one trigger

Viewed 68

I have 3 timers, 10 seconds, 1 min and 5 mins, they all carry out work against the same resource so if they run at the same time one or more may error.

I want to make sure that only one timer runs and would like others to wait.

I have looked at "singleton" config in host.json but from what the documentations suggest it wont help me. The docs just point at a github issue which unless I am missing something it does not help with my issue.

I could just make the 10 second timer do all the work, but I feel the breaks the design and makes it less clear as to the purpose of each function. I would still need todo some parts a few minutes apart so I would need to say do the 5 mins part every x runs.

The stack is NodeJS and I am using TypeScript

I could use a lock resource, but I was wondering if this can be done via config rather than code.

0 Answers
Related