Support for killing synchronizers.

This commit is contained in:
Burak Kaan Köse
2025-01-25 00:00:10 +01:00
parent 20010e77ae
commit 973ab1570d
19 changed files with 189 additions and 56 deletions

View File

@@ -139,11 +139,14 @@ namespace Wino.Core.Synchronizers.ImapSync
}
finally
{
if (remoteFolder != null)
if (!cancellationToken.IsCancellationRequested)
{
if (remoteFolder.IsOpen)
if (remoteFolder != null)
{
await remoteFolder.CloseAsync().ConfigureAwait(false);
if (remoteFolder.IsOpen)
{
await remoteFolder.CloseAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
}