问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/43373953/does-azure-start-up-another-instance-of-a-scheduled-web-job-if-it-is-already-run