New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hangfire disposes of autofac dependencies which are defined as SingleInstance #329
Comments
If the problem still actual? I'm just curious, what do you call in the |
Well the issue is still there, we redesigned the code slightly to work around it, but I think this should be fixed somehow. Even a class which only sets a member to |
So you declare singleton class that implements |
@grisharav, any news? |
I agree it's not a great design, but theoretically, upon shutdown of the process the termination of all singletons (which are evil, I agree) should be done, either explicitly by the user, or by a framework (in my case Autofac) |
@grisharav, after some months, I've changed this behavior in Hangfire 1.5.0-beta1 and Hangfire.Autofac 1.2.0-beta1. In the new Hangfire release I've added the Now, Autofac owns the Thank you for doubts in the previous implementation! I'm closing this issue, please feel free to comment it. |
Using hangfire 1.3.4 with hangfire.autofac 1.0.0 in an ASP.NET application.
I have the following scenario:
What I see is that Autofac executes the recurrent job as requested but then disposes of instance of MyType, which obviously causes failures on subsequent calls for it, since it's defined as a singleton, and should be disposed of by Autofac upon shutdown.
Am I missing something or is this a bug?
The text was updated successfully, but these errors were encountered: