[backend/core] Fix NullReferenceException

This commit is contained in:
Laura Hausmann 2024-03-24 00:25:27 +01:00
parent 9698e3d36d
commit 188a6f4251
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -32,7 +32,6 @@ public class QueueService(IServiceScopeFactory scopeFactory) : BackgroundService
{
_queues.AddRange([InboxQueue, PreDeliverQueue, DeliverQueue, BackgroundTaskQueue]);
await RecoverOrPrepareForExitAsync();
token.Register(RecoverOrPrepareForExit);
_ = Task.Run(RegisterNotificationChannels, token);
@ -147,6 +146,7 @@ public class PostgresJobQueue<T>(
public async Task ExecuteAsync(IServiceScopeFactory scopeFactory, CancellationToken token)
{
_scopeFactory = scopeFactory;
await RecoverOrPrepareForExitAsync();
QueuedChannelEvent += (_, _) => _queuedChannel.Set();
DelayedChannelEvent += (_, _) => _delayedChannel.Set();