We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
According to https://github.com/TinkoffCreditSystems/Horarium/blob/master/src/Horarium.AspNetCore/JobFactory.cs#L16-L24 and https://github.com/TinkoffCreditSystems/Horarium/blob/master/src/Horarium/Handlers/ExecutorJob.cs#L52-L56 all jobs are resolved from captured IServiceProvider in JobsFactory constructor. This is because scope created at https://github.com/TinkoffCreditSystems/Horarium/blob/master/src/Horarium.AspNetCore/JobFactory.cs#L23 never used to resolve jobs, as its return type is IDisposable. Instead, jobs should be resolved from created scope like this: _serviceProvider.CreateScope().ServiceProvider.GetService(type) In particular, it affects using Horarium with EFCore, because DbContext should not to be used by multiple threads at one time.
IServiceProvider
JobsFactory
IDisposable
_serviceProvider.CreateScope().ServiceProvider.GetService(type)
The text was updated successfully, but these errors were encountered:
Merge pull request #19 from wite27/jobs-scope-fix
590b67a
#16: introduced IJobExecutionContext and IJobExecutionContextFactory
Successfully merging a pull request may close this issue.
According to https://github.com/TinkoffCreditSystems/Horarium/blob/master/src/Horarium.AspNetCore/JobFactory.cs#L16-L24 and https://github.com/TinkoffCreditSystems/Horarium/blob/master/src/Horarium/Handlers/ExecutorJob.cs#L52-L56 all jobs are resolved from captured
IServiceProvider
inJobsFactory
constructor. This is because scope created at https://github.com/TinkoffCreditSystems/Horarium/blob/master/src/Horarium.AspNetCore/JobFactory.cs#L23 never used to resolve jobs, as its return type isIDisposable
. Instead, jobs should be resolved from created scope like this:_serviceProvider.CreateScope().ServiceProvider.GetService(type)
In particular, it affects using Horarium with EFCore, because DbContext should not to be used by multiple threads at one time.
The text was updated successfully, but these errors were encountered: