Hi,
I have a to register a hangfire recurrent job in the PostInitialize method in the module. The job class constructor should be resolved by dependancy injection. I have used the following code to register the reccurent job in the module.
JobStorage.Current = new SqlServerStorage(_appConfiguration.GetConnectionString("Default")); RecurringJob.AddOrUpdate<ISendNotificationJob>(x => x.SendDeviceUnlockNotification(), Cron.MinuteInterval(10));
How ever when the SendDeviceUnlockNotification method is called it throws a object disposed exception. Can anyone please help me on this.
public SendNotificationJob(IRepository<Payment> paymentRepository
, IPasstimeDomainService passtimeDomainService , IAppCentre appCentre , UserManager userManager) { _paymentRepository = paymentRepository; _passtimeDomainService = passtimeDomainService; _appCentre = appCentre; _userManager = userManager;
}
2 Answer(s)
-
1
Answered in this SO question: Cannot access a disposed object (on DbContext) error on Hangfire recurrent job in ABP
-
0
Thank you. The solution worked.