Skip to content

Commit

Permalink
fix: Issue with wrong scope for dependent jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Jun 23, 2024
1 parent c1c18e8 commit 74db099
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to **NCronJob** will be documented in this file. The project

## [Unreleased]

### Fixed

- Dependent jobs where registered as singleton instead of scoped. Fixed by [@linkdotnet](https://github.com/linkdotnet).

## [2.8.3] - 2024-06-20

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public static void AddRegistration<TJob>(
services.TryAddSingleton(s);
if (s.Type != typeof(DynamicJobFactory))
{
services.TryAddSingleton(s.Type);
services.TryAddScoped(s.Type);
}
});
jobs.ForEach(j => j.RunWhenSuccess = runWhenSuccess);
Expand Down

0 comments on commit 74db099

Please sign in to comment.