Skip to content

Commit 233df98

Browse files
committed
Don't flush if the service was already paused
Fixes #87
1 parent 861210a commit 233df98

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/FubarDev.FtpServer/Networking/PassThroughService.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ public override async Task StopAsync(CancellationToken cancellationToken)
4242
{
4343
await base.StopAsync(cancellationToken)
4444
.ConfigureAwait(false);
45-
await SafeFlushAsync(cancellationToken)
46-
.ConfigureAwait(false);
45+
46+
if (!IsPauseRequested)
47+
{
48+
await SafeFlushAsync(cancellationToken)
49+
.ConfigureAwait(false);
50+
}
51+
4752
await OnCloseAsync(_exception, cancellationToken)
4853
.ConfigureAwait(false);
4954
}

0 commit comments

Comments
 (0)