Skip to content

Commit 7c5484b

Browse files
committed
Ensure that OnStoppedAsync and OnPausedAsync are getting called
1 parent 434ccb2 commit 7c5484b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/FubarDev.FtpServer/Networking/PausableFtpService.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ await _task
9494
.ConfigureAwait(false);
9595

9696
Status = FtpServiceStatus.Stopped;
97+
98+
if (IsPauseRequested)
99+
{
100+
await OnStoppedAsync(cancellationToken)
101+
.ConfigureAwait(false);
102+
}
97103
}
98104

99105
/// <inheritdoc />
@@ -119,6 +125,14 @@ await OnPauseRequestedAsync(cancellationToken)
119125

120126
await _task
121127
.ConfigureAwait(false);
128+
129+
Status = FtpServiceStatus.Paused;
130+
131+
if (IsStopRequested)
132+
{
133+
await OnPausedAsync(cancellationToken)
134+
.ConfigureAwait(false);
135+
}
122136
}
123137

124138
/// <inheritdoc />

0 commit comments

Comments
 (0)