diff --git a/src/Immediate.Jobs.Shared/Internals/JobSchedulingService.cs b/src/Immediate.Jobs.Shared/Internals/JobSchedulingService.cs index f1341296..b736d72e 100644 --- a/src/Immediate.Jobs.Shared/Internals/JobSchedulingService.cs +++ b/src/Immediate.Jobs.Shared/Internals/JobSchedulingService.cs @@ -152,10 +152,12 @@ ILogger logger /// protected override async Task ExecuteAsync(CancellationToken stoppingToken) { + // initialization needs to be done no matter what, so that storage is initialized + await InitializeAsync(stoppingToken); + if (!_options.IsJobSchedulingServiceEnabled) return; - await InitializeAsync(stoppingToken); MarkStarted(_timeProvider.GetUtcNow()); // Workers observe _workerCancellation rather than stoppingToken: shutdown completes the channel so