Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Azure start up another instance of a scheduled web job if it is already running?

I have a Azure web job that is scheduled to run every 5 minutes using the cron expression in the settings.job file. If the process doesn't finish within 5 minutes will Azure kick off another instance of the job or will it wait until the first one finishes?

I would like to make sure it waits until the first one finishes so it isn't running multiple instances.

like image 560
Austin Avatar asked Mar 09 '23 09:03

Austin


1 Answers

When a scheduled webjob is started, Azure places a lock file. This lock file will remain until the scheduled webjob is completed. If there's an attempt to fire up another scheduled job, you'll get a ConflictException.

You can read about the lock file here. And the code that checks to see if another job is already running is here.

like image 121
Rob Reagan Avatar answered Mar 26 '23 01:03

Rob Reagan