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

Spread the new year cheer all over IRuntimeRegistry #151

Merged
merged 7 commits into from
Jan 2, 2025
Merged

Conversation

nulltoken
Copy link
Collaborator

@nulltoken nulltoken commented Jan 1, 2025

Pull request description

Context:

In order to not have scheduled jobs interfere with unit test runs, I leverage IRuntimeRegistry.RemoveJob<T> in my Xunit Collection fixtures.

As I'd rather disable them (in order to later be able to trigger them through the IInstantJobRegistry), I started working on making DisableJob() accept IJob typed parameters.

Getting there, it was only making sense to also consider EnableJob().

Along the road, I discovered some inconsistencies nearby that I also worked on.

Most relevant proposed changes:

  • Expose typed version of DisableJob()
  • Expose typed version of EnableJob()
  • Make RemoveJob() behave according to its documentation
  • Ensure UpdateSchedule() behavior is consistent

PR meta checklist

  • Pull request is targeted at main branch for code
  • Pull request is linked to all related issues, if any.

Code PR specific checklist

  • My code follows the code style of this project and AspNetCore coding guidelines.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have updated the appropriate sub section in the CHANGELOG.md.
  • I have added, updated or removed tests to according to my changes.
    • All tests passed.

@nulltoken nulltoken requested a review from linkdotnet January 1, 2025 14:42
Copy link

codecov bot commented Jan 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/NCronJob/Registry/IInstantJobRegistry.cs 90.56% <100.00%> (ø)
src/NCronJob/Registry/JobRegistry.cs 98.01% <100.00%> (+2.14%) ⬆️
src/NCronJob/Registry/RuntimeJobRegistry.cs 97.84% <100.00%> (+0.62%) ⬆️
src/NCronJob/Scheduler/JobWorker.cs 93.28% <100.00%> (+4.13%) ⬆️

... and 1 file with indirect coverage changes

@linkdotnet
Copy link
Member

That is quite some new years joy ;)
And happy new year to you :D

@nulltoken
Copy link
Collaborator Author

nulltoken commented Jan 1, 2025

@linkdotnet Changelog and doco have been updated. Could you please take another look?

@nulltoken nulltoken requested a review from linkdotnet January 1, 2025 18:37
@linkdotnet
Copy link
Member

Steven like and appreciate your efforts :D

Thank you very much <3

@nulltoken nulltoken merged commit ddf5046 into main Jan 2, 2025
4 checks passed
@nulltoken nulltoken deleted the ntk/runtime branch January 2, 2025 10:24
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.

2 participants