refactor: add .editorconfig and refactor code

This commit is contained in:
2024-12-25 05:43:30 +03:00
parent 2a33ecbf07
commit 408a95e4b3
45 changed files with 371 additions and 75 deletions

View File

@ -32,7 +32,7 @@ public class ScheduleSyncService : IHostedService, IDisposable
private void OnForceSyncRequested()
{
StopAsync(default).ContinueWith(_ =>
StopAsync(CancellationToken.None).ContinueWith(_ =>
{
_cancellationTokenSource = new CancellationTokenSource();
ExecuteTask(null);
@ -41,9 +41,9 @@ public class ScheduleSyncService : IHostedService, IDisposable
private void OnUpdateIntervalRequested()
{
StopAsync(default).ContinueWith(_ =>
StopAsync(CancellationToken.None).ContinueWith(_ =>
{
StartAsync(default);
StartAsync(CancellationToken.None);
});
}
@ -109,7 +109,7 @@ public class ScheduleSyncService : IHostedService, IDisposable
public void Dispose()
{
StopAsync(default).GetAwaiter().GetResult();
StopAsync(CancellationToken.None).GetAwaiter().GetResult();
_timer?.Dispose();
ScheduleSyncManager.OnForceSyncRequested -= OnForceSyncRequested;
ScheduleSyncManager.OnUpdateIntervalRequested -= OnUpdateIntervalRequested;