Reading the documentation for Topshelf integrations here: https://github.com/dtinteractive/Topshelf.Integrations
And it seems like it should be as simple as scheduling multiple quartz jobs within the HostFactory
but it looks like the second scheduled job is the only one that's running.
I'm not really sure how to proceed from here. But I need to schedule two jobs that run on different schedules. The first is supposed to be run daily while the second gets run hourly.
static void Main(string[] args)
{
HostFactory.Run(x =>
{
x.ScheduleQuartzJobAsService(q =>
q.WithJob(() => JobBuilder.Create<TmsIdImportTask>().Build())
.AddTrigger(() =>
TriggerBuilder.Create()
.WithSimpleSchedule(builder => builder
.WithIntervalInMinutes(Int32.Parse(ConfigurationManager.AppSettings["ScheduleImportFrequencyInMinutes"]))
.RepeatForever()).Build())
);
x.ScheduleQuartzJobAsService(q =>
q.WithJob(() => JobBuilder.Create<ImportTmsXMLTask>().Build())
.AddTrigger(() => TriggerBuilder.Create().WithSimpleSchedule(builder =>
builder.WithIntervalInMinutes(Int32.Parse(ConfigurationManager.AppSettings["TMSImportFrequencyInMinutes"]))
.RepeatForever()).Build())
);
x.RunAsLocalSystem();
var description = ConfigurationManager.AppSettings["ServiceDescription"];
x.SetDescription(description);
var displayName = ConfigurationManager.AppSettings["ServiceDisplayName"];
x.SetDisplayName(displayName);
var serviceName = ConfigurationManager.AppSettings["ServiceName"];
x.SetServiceName(serviceName);
});
}
Start()
and shutdown onStop()
methods? Why use this integration at all? – Stagestruck