Skip to content
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

Changed service registration from Transient to Singleton to allow consume it #2064

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krzysiek-b
Copy link

Seems like it makes more sense to register the service as Singleton to allow any consumer inject it into its classes rather than having this transient and not being able to consume it at all.

@krzysiek-b krzysiek-b changed the title Changed service registration from Transient to Singleton to able consume it Changed service registration from Transient to Singleton to allow consume it Jul 22, 2022
@odinserj
Copy link
Member

odinserj commented Aug 1, 2022

Unfortunately this will break existing code, where multiple background job servers are started in the same application that's an existing use case. Different applications, different environments, as far as I remember BackgroundJobServerHostedService class is public so you can use your own registrations directly instead of calling the AddHangfireServer method.

@domagojmedo
Copy link

@odinserj why not also close PR since it will never be merged because of breaking changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants