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

Add IServiceProvider access when registering scheduled job #47

Closed
stijnmoreels opened this issue Nov 25, 2021 · 2 comments · Fixed by #48 or #50
Closed

Add IServiceProvider access when registering scheduled job #47

stijnmoreels opened this issue Nov 25, 2021 · 2 comments · Fixed by #48 or #50

Comments

@stijnmoreels
Copy link
Contributor

Describe the feature you would like to have:
Currently, a scheduled job can be added without any IServiceProvider access. This can be rather tedious as when registering an UnobservedTaskExceptionHandler, one might want to use the registered ILogger<> instead.
In the sample app in this repo, we see the same problem recurring.

A possible way, is to add an overload that takes in Action<SchedulerBuilder, IServiceProvider> or something like that, so the configuration can access the IServiceProvider and the registered services.

File to change

@kdcllc
Copy link
Owner

kdcllc commented Jun 12, 2022

@stijnmoreels I am sorry for the delay in merging your changes. I completed your changes here #50

@stijnmoreels
Copy link
Contributor Author

stijnmoreels commented Jun 13, 2022

@stijnmoreels I am sorry for the delay in merging your changes. I completed your changes here #50

Oh, that's great! 🥳
Thx!
Hope it helps people when managing their scheduled jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants