fix: new variable for group name

This commit is contained in:
Guillermo Marcel 2025-02-15 16:05:11 -03:00
parent 8fbe439ed4
commit 27dfcb291a

View File

@ -35,19 +35,20 @@ public class AutoScanApp
await _scheduler.Start(cancellationToken);
_logger.LogDebug("Scheduler started successfully!");
const string group = "ScanGroup";
const string groupName = "ScanGroup";
IJobDetail downloaderJob = JobBuilder.Create<DownloaderJob>()
.WithIdentity("downloader", group)
.WithIdentity("downloader", groupName)
.Build();
//Job with no trigger but tied to the chainer to be executed after the downloader job
IJobDetail scannerJob = JobBuilder.Create<ScannerJob>()
.WithIdentity("scanner", group)
.StoreDurably(true)
.WithIdentity("scanner", groupName)
.StoreDurably()
.Build();
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("trigger1", group)
.WithIdentity("trigger1", groupName)
.WithCronSchedule(cron)
.StartNow()
.Build();
@ -55,7 +56,7 @@ public class AutoScanApp
var chainer = _chainerListenerFactory.CreateChainerListener("Scan Chainer");
chainer.AddJobChainLink(downloaderJob.Key, scannerJob.Key);
_scheduler.ListenerManager.AddJobListener(chainer, GroupMatcher<JobKey>.GroupEquals(group));
_scheduler.ListenerManager.AddJobListener(chainer, GroupMatcher<JobKey>.GroupEquals(groupName));
await _scheduler.ScheduleJob(downloaderJob, trigger, cancellationToken);
await _scheduler.AddJob(scannerJob, false, true, cancellationToken);