mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-03 19:08:20 -04:00
Fixed: Multiple SignalR Improvements
Support for serverSentEvents, connection optimizations Co-Authored-By: taloth <taloth@users.noreply.github.com>
This commit is contained in:
@@ -25,6 +25,8 @@ namespace Lidarr.Http
|
||||
|
||||
public void Handle(ModelEvent<TModel> message)
|
||||
{
|
||||
if (!_signalRBroadcaster.IsConnected) return;
|
||||
|
||||
if (message.Action == ModelAction.Deleted || message.Action == ModelAction.Sync)
|
||||
{
|
||||
BroadcastResourceChange(message.Action);
|
||||
@@ -35,6 +37,8 @@ namespace Lidarr.Http
|
||||
|
||||
protected void BroadcastResourceChange(ModelAction action, int id)
|
||||
{
|
||||
if (!_signalRBroadcaster.IsConnected) return;
|
||||
|
||||
if (action == ModelAction.Deleted)
|
||||
{
|
||||
BroadcastResourceChange(action, new TResource { Id = id });
|
||||
@@ -48,6 +52,8 @@ namespace Lidarr.Http
|
||||
|
||||
protected void BroadcastResourceChange(ModelAction action, TResource resource)
|
||||
{
|
||||
if (!_signalRBroadcaster.IsConnected) return;
|
||||
|
||||
if (GetType().Namespace.Contains("V1"))
|
||||
{
|
||||
var signalRMessage = new SignalRMessage
|
||||
@@ -64,6 +70,8 @@ namespace Lidarr.Http
|
||||
|
||||
protected void BroadcastResourceChange(ModelAction action)
|
||||
{
|
||||
if (!_signalRBroadcaster.IsConnected) return;
|
||||
|
||||
if (GetType().Namespace.Contains("V1"))
|
||||
{
|
||||
var signalRMessage = new SignalRMessage
|
||||
|
||||
Reference in New Issue
Block a user