fix initialization, throttle operations

day/winter/night switcher fixes
This commit is contained in:
Alex Bezdieniezhnykh
2025-02-19 23:07:16 +02:00
parent c314268d1e
commit d1af7958f8
17 changed files with 170 additions and 88 deletions
+3 -2
View File
@@ -30,6 +30,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
private readonly IAuthProvider _authProvider;
private readonly QueueConfig _queueConfig;
private Consumer _consumer = null!;
private static readonly Guid SaveTaskId = Guid.NewGuid();
public AnnotationService(
IResourceLoader resourceLoader,
@@ -95,7 +96,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
{
_dbFactory.SaveToDisk();
return Task.CompletedTask;
}, TimeSpan.FromSeconds(3), cancellationToken);
}, SaveTaskId, TimeSpan.FromSeconds(3), cancellationToken);
}
});
@@ -184,7 +185,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
{
_dbFactory.SaveToDisk();
return Task.CompletedTask;
}, TimeSpan.FromSeconds(5), token);
}, SaveTaskId, TimeSpan.FromSeconds(5), token);
return annotation;
}