i've web job grab file internet , process it. have tied s scheduler run everyday @ mid-night.
sometimes grab file process fails , throws exception crashes web jobs , stops till scheduler kicks again next day.
to stop app crashing, 1 option have wrap try-catch block , handle error. want able re-run web jobs after fails.
is there way me tell azure scheduler re-run task n number of times after fails?
for example, want web jobs re-run after 5 minutes of fail at-most 5 times. don't want wait scheduler kick in next day.
is there way me tell azure scheduler re-run task n number of times after fails?
azure scheduler not provide way verify if "remote" execution succeeded or not, can use "storage queue" action type put message specified queue , achieve same behavior in web job itself. azure web jobs sdk process incoming message , retry up 5 times if exception thrown, queue processor extensible (since 1.1), can implement exponential retry policy or whatever policy need (by extending queueprocessor , queueprocessorfactory classes).
steps:
- update actual web job consume queue (by using
[queuetrigger("myqueue")]
), , configure "continuous running" (in vs project , azure web app). - create azure scheduler job of type "storage queue", push message mentioned queue.
note: option requires standard tier in web app (due "continuous running")
Comments
Post a Comment