mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 13:06:31 +00:00
fix initialization, throttle operations
day/winter/night switcher fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user