在 C# 中清除quartz.net ramjobstore而不重新启动应用程序的正确方法是什么
如果有办法做到这一点,我也可以通过查看清除之前和之后的 ramstore 来确认。我们如何以编程方式查看 ramstore 的内容?就我而言,我正在从文件中读取所有作业和触发器信息。在某些自定义事件中,我需要停止调度程序并重新开始,而无需重新启动应用程序。 谢谢
If there is a way to do this , can I also confirm by viewing the ramstore before and after clear. How can we view the contents of the ramstore programmatically ? In my case I am reading all job and trigger info from file. On some custom event I need to stop the scheduler and start all over again without re-starting the app.
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Quartz.NET 框架中的 RamJobStore 提供了多种方法来查看其内容,最简单的是“GetJobGroupNames()”和“GetJobNames()”函数:
您可以这样使用它:
当然,这不是 你想要什么,因为它只会显示一个消息框,显示你在 RamJobStore 中的所有作业,但它确实允许你查看整个商店的内容。此外,您现在可以使用两种方法来删除所有作业。您可以使用函数“RemoveJob()”或“Shutdown()”。
这只会删除对象上的所有作业,但在大型商店中可能会很耗时。因此,还有一个“Shutdown()”函数,它只是从内存中删除整个存储(之后您可以创建一个新存储)。
我将...放入某些函数中,这是您最初用来存储作业的SchedulingContext。
The RamJobStore from the Quartz.NET frameworks provides several methods to view it's contents, the easiest is the 'GetJobGroupNames()' and 'GetJobNames()' functions:
You can use it like this:
Of course this is not what you want, since it will just show a message box for all the jobs you have in your RamJobStore, but it does allow you to view the contents of the entire store. Furthermore you can now use two methods to remove all the jobs. You can either use the function 'RemoveJob()' or 'Shutdown()'.
This will just remove all the jobs on the object, but might be time consuming on large store(s). Therefore there is also a 'Shutdown()' function, which just removes the entire store from memory (after which you can create a new one).
I put ... in some of the function(s), which is your SchedulingContext you've used to store the jobs in the first place.
文档仅供参考:
在这里找到: http:// /www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/job-stores.html
根据我对quartz的有限经验,我认为你可以只获取调度程序的内容,然后关闭下调度程序并开始一个新的调度程序?
fyi from the documentation:
Found Here: http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/job-stores.html
In my limited experience with quartz, i would think you could just grab the contents of the scheduler and then shut down the scheduler and start a new one?