Skip to content

Restore compatibility with Quartz v3.12.0 and newer #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageVersion Include="NVelocity" Version="1.2.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Quartz" Version="3.2.3" />
<PackageVersion Include="Quartz" Version="3.12.0" />
<PackageVersion Include="System.CodeDom" Version="5.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.119" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public Task Execute(IJobExecutionContext context)
{
ObjectWrapper bw = new ObjectWrapper(this);
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.AddAll(context.Scheduler.Context);
pvs.AddAll(context.MergedJobDataMap);
pvs.AddAll((IDictionary<string, object>) context.Scheduler.Context);
pvs.AddAll((IDictionary<string, object>) context.MergedJobDataMap);
bw.SetPropertyValues(pvs, true);
}
catch (SchedulerException ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ protected virtual IScheduler FindScheduler(string schedulerName)
}
}

IScheduler schedulerInRepo = SchedulerRepository.Instance.Lookup(schedulerName)
.ConfigureAwait(false).GetAwaiter().GetResult();
IScheduler schedulerInRepo = SchedulerRepository.Instance.Lookup(schedulerName);
if (schedulerInRepo == null)
{
throw new InvalidOperationException("No Scheduler named '" + schedulerName + "' found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ protected virtual IScheduler CreateScheduler(ISchedulerFactory schedulerFactory,
lock (repository)
{
IScheduler existingScheduler = schedulerName != null
? repository.Lookup(schedulerName).ConfigureAwait(false).GetAwaiter().GetResult()
? repository.Lookup(schedulerName)
: null;

IScheduler newScheduler =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ protected override object CreateJobInstance(TriggerFiredBundle bundle)
MutablePropertyValues pvs = new MutablePropertyValues();
if (schedulerContext != null)
{
pvs.AddAll(schedulerContext);
pvs.AddAll((IDictionary<string, object>) schedulerContext);
}

pvs.AddAll(bundle.JobDetail.JobDataMap);
pvs.AddAll(bundle.Trigger.JobDataMap);
pvs.AddAll((IDictionary<string, object>) bundle.JobDetail.JobDataMap);
pvs.AddAll((IDictionary<string, object>) bundle.Trigger.JobDataMap);
if (ignoredUnknownProperties != null)
{
for (int i = 0; i < ignoredUnknownProperties.Length; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,9 +923,10 @@ public void TestSchedulerAutoStartupFalse()
public async Task TestSchedulerRepositoryExposure()
{
XmlApplicationContext ctx = new XmlApplicationContext("schedulerRepositoryExposure.xml");
var expected = await SchedulerRepository.Instance.Lookup("myScheduler");
var expected = SchedulerRepository.Instance.Lookup("myScheduler");
Assert.AreSame(expected, ctx.GetObject("scheduler"));
ctx.Dispose();
await Task.CompletedTask;
}

/// <summary>
Expand Down