0
OriAssurant created
Hi Abp Zero Support,
Is there any particular reason for BackgroundJob to be Transient in the document? Is there any downside if I make it Singleton?
public class TestJob : BackgroundJob<int>, ITransientDependency
{
public override void Execute(int number)
{
Logger.Debug(number.ToString());
}
}
https://aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers
Thank you, R
4 Answer(s)
-
0
Implementing ITransientDependency is the simplest way.
For the lifetimes of the dependency injection service, please refer to: https://medium.com/volosoft/asp-net-core-dependency-injection-best-practices-tips-tricks-c6e9c67f9d96
-
0
Thank you for the response maliming. Do you mean it's not using ISingletonDependency because ISingletonDependency is more error prone, like concurrency conflicts and memory lead, for a background job?
-
0
Yes
-
0
This issue is closed because it has not had recent activity for a long time.