获取 Quartz.NET 3.0 中的所有工作
Get all jobs in Quartz.NET 3.0
我有 运行 正确的工作,但我需要从另一个应用程序中列出这些工作。我正在使用 Quartz 版本 3.0.7
我使用了以下代码:
var collJobGroups = await pScheduler.GetJobGroupNames();
但它没有 return 任何东西。
这一个:
StdSchedulerFactory factory = new StdSchedulerFactory(System.Configuration.ConfigurationManager.AppSettings);
IScheduler scheduler = await factory.GetScheduler();
await scheduler.Start();
IReadOnlyCollection<string> jgn = await scheduler.GetJobGroupNames(new System.Threading.CancellationToken());
如果两个应用程序都可以访问同一个数据库,那么我建议您查看 ADO.NET Job Store 而不是 RAMJobStore。当您将数据库用作 Job Store 时,您可以在一个应用程序中使用 Scheduler 运行,并且可以通过另一个应用程序读取作业信息。
唯一的问题是您需要在单独的 class 库中实现作业,因为您需要访问 classes 来创建 JobDetails。
我有 运行 正确的工作,但我需要从另一个应用程序中列出这些工作。我正在使用 Quartz 版本 3.0.7
我使用了以下代码:
var collJobGroups = await pScheduler.GetJobGroupNames();
但它没有 return 任何东西。 这一个:
StdSchedulerFactory factory = new StdSchedulerFactory(System.Configuration.ConfigurationManager.AppSettings);
IScheduler scheduler = await factory.GetScheduler();
await scheduler.Start();
IReadOnlyCollection<string> jgn = await scheduler.GetJobGroupNames(new System.Threading.CancellationToken());
如果两个应用程序都可以访问同一个数据库,那么我建议您查看 ADO.NET Job Store 而不是 RAMJobStore。当您将数据库用作 Job Store 时,您可以在一个应用程序中使用 Scheduler 运行,并且可以通过另一个应用程序读取作业信息。 唯一的问题是您需要在单独的 class 库中实现作业,因为您需要访问 classes 来创建 JobDetails。