I have this api endpoint method which uses Hangfire
. How do I make sure that PreIngestion()
is completed first before IngestA()
and IngestB()
could be executed?
[HttpGet]
[Route("IngestFiles")]
public IActionResult IngestFiles(string cronExpression = "0")
{
RecurringJob.AddOrUpdate<IIngestService>(x => x.PreIngestion(), cronExpression, TimeZoneInfo.Local);
RecurringJob.AddOrUpdate<IIngestService>(x => x.IngestA(), cronExpression, TimeZoneInfo.Local);
RecurringJob.AddOrUpdate<IIngestService>(x => x.IngestB(), cronExpression, TimeZoneInfo.Local);
return Ok();
}