mirror of
https://github.com/Stone-Red-Code/EchoHub.git
synced 2026-09-04 00:56:05 +02:00
Merge pull request #4 from HueByte/dev
fix: Improve shutdown process for IRC Gateway and Server Directory se…
This commit is contained in:
@@ -4,6 +4,7 @@ Release history for EchoHub.
|
|||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
|
- [v0.2.1](v0.2.1.md) - Shutdown & CI Fixes
|
||||||
- [v0.2.0](v0.2.0.md) - IRC Gateway
|
- [v0.2.0](v0.2.0.md) - IRC Gateway
|
||||||
- [v0.1.1](v0.1.1.md) - Directory Connection Self-Healing
|
- [v0.1.1](v0.1.1.md) - Directory Connection Self-Healing
|
||||||
- [v0.1.0](v0.1.0.md) - Initial Release
|
- [v0.1.0](v0.1.0.md) - Initial Release
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
- name: Overview
|
- name: Overview
|
||||||
href: index.md
|
href: index.md
|
||||||
|
- name: v0.2.1
|
||||||
|
href: v0.2.1.md
|
||||||
- name: v0.2.0
|
- name: v0.2.0
|
||||||
href: v0.2.0.md
|
href: v0.2.0.md
|
||||||
- name: v0.1.1
|
- name: v0.1.1
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# v0.2.1 - Shutdown & CI Fixes
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed server hanging on Ctrl+C when the directory server is unreachable — `StopAsync` now cancels background services before disposing connections
|
||||||
|
- Fixed IRC gateway shutdown blocking indefinitely on unresponsive clients — send operations are now bounded to 2 seconds
|
||||||
|
- Fixed CI release workflow not having full git history for building release notes (`fetch-depth: 0`)
|
||||||
|
- Fixed `workflow_dispatch` trigger breaking change detection when `github.event.before` is empty
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
|
||||||
|
- GitHub releases now include a commit list and version diff link instead of generic auto-generated notes
|
||||||
|
- GitHub releases link to the full changelog on the docs site
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>0.1.1</Version>
|
<Version>0.2.1</Version>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -141,17 +141,24 @@ public sealed class IrcGatewayService : BackgroundService
|
|||||||
|
|
||||||
public override async Task StopAsync(CancellationToken cancellationToken)
|
public override async Task StopAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
// Cancel ExecuteAsync first so listeners stop accepting
|
||||||
|
await base.StopAsync(cancellationToken);
|
||||||
|
|
||||||
|
// Force-close any remaining client connections
|
||||||
foreach (var (_, conn) in _connections)
|
foreach (var (_, conn) in _connections)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await conn.SendAsync("ERROR :Server shutting down");
|
await conn.SendAsync("ERROR :Server shutting down")
|
||||||
await conn.DisposeAsync();
|
.WaitAsync(TimeSpan.FromSeconds(2));
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
try { await conn.DisposeAsync(); }
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_connections.Clear();
|
_connections.Clear();
|
||||||
|
|
||||||
await base.StopAsync(cancellationToken);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,13 +177,9 @@ public sealed class ServerDirectoryService(
|
|||||||
|
|
||||||
public override async Task StopAsync(CancellationToken cancellationToken)
|
public override async Task StopAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (_connection is not null)
|
// Cancel ExecuteAsync first — it disposes the connection via await using
|
||||||
{
|
|
||||||
await _connection.DisposeAsync();
|
|
||||||
_connection = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
await base.StopAsync(cancellationToken);
|
await base.StopAsync(cancellationToken);
|
||||||
|
_connection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user