Is there a way to schedule a job without having listen to the queue? I mean I would like to run it every hour or so and do something, regardless of the queue. Does that even make sense? One solution I can think of is to queue a message to itself each time the job is done, but that doesn't look like a clean solution to me.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Create a scheduled job with a 1 hour frequency and use Host.Call to invoke the function. See the ManualTrigger
function in this code sample
回答2:
Of course, no need to listen to a queue. Check the WebJobs documentation on how to schedule a job: http://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduled
回答3:
The easiest way to schedule a job is to use a TimerTrigger on the WebJob method you'd like to execute on a schedule.