Quartz.net不持续每日时间间隔

发布于 2025-02-06 20:43:16 字数 1330 浏览 1 评论 0原文

我已经注意到石英NET并未将所有触发类型持续到数据库。例如,在每日间隔没有的情况下,cron触发器会持续存在。是否有设置可以允许持续到数据库的所有触发类型?

var props = new NameValueCollection
{
    {"quartz.jobStore.type", "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" },
    {"quartz.jobStore.lockHandler.type", "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"},
    {"quartz.jobStore.useProperties", "true"},
    {"quartz.jobStore.dataSource", "default"},
    {"quartz.jobStore.tablePrefix", "QRTZ_"},
    {"quartz.jobStore.driverDelegateType", "Quartz.Impl.AdoJobStore.SQLiteDelegate, Quartz"},
    {"quartz.dataSource.default.provider", "SQLite"},
    {"quartz.dataSource.default.connectionString", "Data Source=MyDBFile.db;Version=3;Foreign Keys=ON;"},
    {"quartz.serializer.type", "json"},
    {"quartz.scheduler.typeLoadHelper.type" , MyTypeLoadHelper },
    {"quartz.plugin.recentHistory.type", "Quartz.Plugins.RecentHistory.ExecutionHistoryPlugin, Quartz.Plugins.RecentHistory" },
    {"quartz.plugin.recentHistory.storeType", "Quartz.Plugins.RecentHistory.Impl.InProcExecutionHistoryStore, Quartz.Plugins.RecentHistory" },
    {"quartz.serializer.type", "MySerializerType" }
};

services.AddSingleton<ISchedulerFactory>(new StdSchedulerFactory(props));

Update

如果您阻止石英处理,则每天的间隔将保存到DB。但是,一旦重复间隔一旦将其从数据库删除,即使它计划在多天进行运行。

I have noticed the Quartz.Net does not persist all trigger types to the data base. For example the CRON trigger gets persisted while the Daily Interval does not. Is there a setting to allow persisting all trigger types to the database?

var props = new NameValueCollection
{
    {"quartz.jobStore.type", "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" },
    {"quartz.jobStore.lockHandler.type", "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"},
    {"quartz.jobStore.useProperties", "true"},
    {"quartz.jobStore.dataSource", "default"},
    {"quartz.jobStore.tablePrefix", "QRTZ_"},
    {"quartz.jobStore.driverDelegateType", "Quartz.Impl.AdoJobStore.SQLiteDelegate, Quartz"},
    {"quartz.dataSource.default.provider", "SQLite"},
    {"quartz.dataSource.default.connectionString", "Data Source=MyDBFile.db;Version=3;Foreign Keys=ON;"},
    {"quartz.serializer.type", "json"},
    {"quartz.scheduler.typeLoadHelper.type" , MyTypeLoadHelper },
    {"quartz.plugin.recentHistory.type", "Quartz.Plugins.RecentHistory.ExecutionHistoryPlugin, Quartz.Plugins.RecentHistory" },
    {"quartz.plugin.recentHistory.storeType", "Quartz.Plugins.RecentHistory.Impl.InProcExecutionHistoryStore, Quartz.Plugins.RecentHistory" },
    {"quartz.serializer.type", "MySerializerType" }
};

services.AddSingleton<ISchedulerFactory>(new StdSchedulerFactory(props));

UPDATE

If you stop Quartz from processing then Daily Interval is saved to the DB. However, once the repeat interval is done once it will delete it from the db, even though it is scheduled to run on multiple days.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文