What's the best way to implement a scheduled job using a windows service

限于喜欢 提交于 2019-12-31 03:25:07

问题


I have a database job that runs occasionally at night and I need a windows service to poll the database regularly to do some more work after the SQL job is done. I am a looking for a solid example to write a scheduler that can fail gracefully without crashing the service.


回答1:


Take a look at http://codeplex.com/TaskService




回答2:


Just make it a scheduled task. See windows service vs scheduled task




回答3:


I would use MSMQ, add a final step to the job that adds a message to the queue (Via ActiveX Script / COM or a .net call if you can)

Then have your service monitoring the Queue.

As far as not crashing the service, that would all be up to you and error handling etc...



来源:https://stackoverflow.com/questions/819802/whats-the-best-way-to-implement-a-scheduled-job-using-a-windows-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!