Azure WebJob计划问题 [英] Azure WebJob Scheduling Question

查看:112
本文介绍了Azure WebJob计划问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照说明创建了一个Web作业,然后与一个Web应用程序关联,以便它们一起发布.我在setting.job文件中创建了已触发"的WebJob,其中包含:{ "schedule":"0 */15 * * * *"),但后来我也(另一个 示例)创建了一个具有以下签名的方法: 

I followed instructions to create a webjob and then associate with a webapp so that they publish together.  I created the WebJob as Triggered in setting.job file containing: { "schedule": "0 */15 * * * *"} but then I also (another example) created a method with this signature: 

public static void CleanUp([TimerTrigger("00:10:00",RunOnStartup = true,UseMonitor = true)] TimerInfo timerInfo,TextWriter日志)

public static void CleanUp([TimerTrigger("00:10:00", RunOnStartup = true, UseMonitor = true)] TimerInfo timerInfo, TextWriter log)

该Webjob在Azure门户中显示为"0 */15 * * * *"计划被触发但是,它实际上每10分钟运行一次.

The webjob shows up in Azure portal as Triggered with a Schedule of "0 */15 * * * *" BUT..it actually runs every 10 minutes.

我希望setttings.job可以控制时间,因为这是可见的,并且避免了两次浸渍……这样做的正确方法是什么?

I'd prefer the setttings.job to control the timing since that is visible and avoid the double dipping...what's the correct way to do this?


推荐答案

迪安娜,

根据您的描述,您正在使用Webjob SDK和Webjob的内置CRON配置.您需要选择一个. settings.job文件绝对很容易随时更改,因为它不需要重新部署 Webjob的.没有正确"的提示.两种方法都是有效的选择,这取决于您的需求.根据您的意见,尽管我建议您坚持使用基本的控制台应用程序(没有上面定义的方法签名) 使用webjob SDK),并使用带有CRON表达式的settings.job文件来触发webjob.

Based on what you described you are using both the Webjob SDK and the built in CRON configuration of the webjob. You'll want to choose one or the other. The settings.job file is definitely easier to change on the fly as it will not require a redeployment of the webjob. There isn't a "correct" way to do this as both are valid options, it just depends on your needs. Based on what you've said though I'd recommend sticking with a basic console application (without the method signature you defined above using the webjob SDK) and using the settings.job file with your CRON expression to trigger the webjob.


这篇关于Azure WebJob计划问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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