My recurring job in Hangfire is not being triggered regardless of what Schedule I put in. I have tried using BackgroundJob just to make sure that something is working, and it does. I have also checked the database and the “hash” table is being populated correctly with the scheduled jobs.
Here is the code I am working with:
try
{
using(var server = new BackgroundJobServer(serverOptions,storage))
{
Log("Hangfire server started");
RecurringJob.AddOrUpdate("Mail", () =>
_notificationHelper.SendEmail(result)
, Cron.MinuteInterval(1), TimeZoneInfo.Local
);
//BackgroundJob.Enqueue(() => _notificationHelper.SendEmail(result));
}
}
So what am I doing wrong here?