Skip to content

Commit 966c4bb

Browse files
committed
fix: implement graceful shutdown in StopAsync()
1 parent e82ca11 commit 966c4bb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Src/TeleFrame/Application/TelegramBotApplication.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ public async Task StartAsync(CancellationToken cancellationToken = default)
110110
/// A completed <see cref="Task" /> since the underlying host lifecycle is gracefully controlled via shutdown
111111
/// signals.
112112
/// </returns>
113-
public Task StopAsync(CancellationToken cancellationToken = new())
113+
public async Task StopAsync(CancellationToken cancellationToken = default)
114114
{
115115
_logger.LogInformation("Telegram bot stopping...");
116-
return Task.CompletedTask;
116+
await _host.StopAsync(cancellationToken);
117117
}
118118

119119
/// <summary>

Src/TeleFrame/TeleFrame.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageId>TeleFrame</PackageId>
99
<Description> </Description>
1010
<RepositoryUrl>https://github.com/M0BIN-V/TeleFrame</RepositoryUrl>
11-
<Version>1.3.2</Version>
11+
<Version>1.3.3</Version>
1212
<PackageIcon>TeleFrame.png</PackageIcon>
1313
<PackageReadmeFile>README.md</PackageReadmeFile>
1414
<PackageLicenseFile>LICENCE</PackageLicenseFile>

0 commit comments

Comments
 (0)