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

Fix Development mode #28

Merged
merged 2 commits into from
Feb 5, 2024
Merged

Fix Development mode #28

merged 2 commits into from
Feb 5, 2024

Conversation

WillSoss
Copy link
Member

@WillSoss WillSoss commented Feb 5, 2024

Fixes unresolvable jobs when DOTNET_ENVIRONMENT is set to Development (Environment.IsDevelopment = true). This was due to the Host.CreateDefaultBuilder setting ServiceProviderOptions.ValidateOnBuild = Environment.IsDevelopment which then caused the ServiceProvider to create an instance of each job registered (all jobs in the JobCache).

This fix no longer adds all jobs in the JobCache to the service collection and changes ServiceExtensions.AddConfig into AddJob which adds the job and config that is being run, therefore passing the service provider validation with all of it's dependencies being present.

@WillSoss WillSoss requested a review from broline February 5, 2024 21:31
@WillSoss WillSoss merged commit 2f37df4 into master Feb 5, 2024
6 checks passed
@WillSoss WillSoss deleted the fix/dev-mode branch February 5, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants