开发者

How to handle application shutdown in Quartz.Net

开发者 https://www.devze.com 2023-01-17 21:37 出处:网络
I have used Quartz.Net for queuing and sending email开发者_Go百科s from my application. I don\'t know how each scheduled job responds to application instance stopping, pausing or shutting down. The IJ

I have used Quartz.Net for queuing and sending email开发者_Go百科s from my application. I don't know how each scheduled job responds to application instance stopping, pausing or shutting down. The IJob interface has no method that can notify a running job about these events.

My question is how can I handle these cases when they occur so that the job can exit while leaving the application and the data in a stable state?


Make sure you call IScheduler.Shutdown(true) when your application shuts down. This will wait for all jobs to finish and ensure everything is cleaned up correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消