Azure是否已启动计划的Web作业的另一个实例(如果已运行)? [英] Does Azure start up another instance of a scheduled web job if it is already running?

查看:49
本文介绍了Azure是否已启动计划的Web作业的另一个实例(如果已运行)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Azure Web作业,该作业计划使用settings.job文件中的cron表达式每5分钟运行一次.如果该过程在5分钟内未完成,Azure会启动该作业的另一个实例还是会等到第一个实例完成?

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.

推荐答案

启动计划的Web作业时,Azure将放置一个锁定文件.该锁定文件将一直保留到计划的webjob完成为止.如果尝试启动另一个计划的作业,则会收到ConflictException.

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.

这篇关于Azure是否已启动计划的Web作业的另一个实例(如果已运行)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆