Add SSE disconnect logic
This commit is contained in:
1 parent
1c60556cc8
commit
3dedc315ca
1 file changed
+7
-1
@@ -36,7 +36,13 @@ public class SSEConnection
|
|||||||
if (!OutboundQueue.TryDequeue(out var outgoingEvent))
|
if (!OutboundQueue.TryDequeue(out var outgoingEvent))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
await ctx.Response.SendChunk(outgoingEvent.Build(), Token);
|
if (!await ctx.Response.SendChunk(outgoingEvent.Build(), Token))
|
||||||
|
{
|
||||||
|
Plugin.Log.Information("SSE connection was unable to send new data");
|
||||||
|
Plugin.Log.Information($"Client disconnected: {ctx.Guid}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user