Skip to content

Commit 60a13ab

Browse files
committed
🎨 Send pipeclosed message on exit
1 parent e5f55c0 commit 60a13ab

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/CloudlogHelper/Services/PluginService.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@ private void StartHeartbeat(CancellationToken token)
111111
private void StopAll()
112112
{
113113
if (_disposed) return;
114+
115+
_ = Task.Run(async () =>
116+
{
117+
try
118+
{
119+
await SendMessage(new PipeConnectionClosed()
120+
{
121+
Timestamp = Timestamp.FromDateTime(DateTime.UtcNow)
122+
}, CancellationToken.None);
123+
}
124+
catch (Exception e)
125+
{
126+
//ignored
127+
}
128+
});
129+
114130
_disposed = true;
115131

116132
_heartbeatCts?.Cancel();

0 commit comments

Comments
 (0)