5

I need to manually invoke some Quartz.NET jobs and wait for them to complete. Please see the simplified sample code below:

[HttpPost("[action]/{jobKey}")]
public async Task<IActionResult> StartJob(string jobKey)
{
    await _schedulerService.Scheduler.TriggerJob(new Quartz.JobKey(jobKey)); 
    return Ok();
}

However, using TriggerJob will not wait also for the execution of the job itself to complete. Is it possible to achieve this using Quartz.NET? I am using it on .NET Core, with the following package:

 <PackageReference Include="Quartz" Version="3.0.7" />
walen
  • 7,103
  • 2
  • 37
  • 58
Cosmin Vană
  • 1,562
  • 12
  • 28

0 Answers0