Skip to content

Commit 74db099

Browse files
committed
fix: Issue with wrong scope for dependent jobs
1 parent c1c18e8 commit 74db099

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to **NCronJob** will be documented in this file. The project
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- Dependent jobs where registered as singleton instead of scoped. Fixed by [@linkdotnet](https://github.com/linkdotnet).
12+
913
## [2.8.3] - 2024-06-20
1014

1115
### Changed

src/NCronJob/Configuration/Builder/NCronJobOptionBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public static void AddRegistration<TJob>(
366366
services.TryAddSingleton(s);
367367
if (s.Type != typeof(DynamicJobFactory))
368368
{
369-
services.TryAddSingleton(s.Type);
369+
services.TryAddScoped(s.Type);
370370
}
371371
});
372372
jobs.ForEach(j => j.RunWhenSuccess = runWhenSuccess);

0 commit comments

Comments
 (0)