mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 17:07:22 +01:00
fix mediatorspam
This commit is contained in:
parent
8ac6251179
commit
c66008aa42
2 changed files with 3 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ public class MareMediator : IDisposable
|
|||
Stopwatch globalStopwatch = Stopwatch.StartNew();
|
||||
_performanceCollector.LogPerformance(this, $"Publish>{message.GetType().Name}", () =>
|
||||
{
|
||||
foreach (var subscriber in subscribers.ToList())
|
||||
foreach (var subscriber in subscribers.Where(s => s.Subscriber != null).ToList())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -52,7 +52,7 @@ public class MareMediator : IDisposable
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical(ex, "Error executing {type} for subscriber {subscriber}, removing from Mediator", message.GetType(), subscriber);
|
||||
subscribers.RemoveWhere(s => s == subscriber);
|
||||
_subscriberDict[message.GetType()].RemoveWhere(s => s == subscriber);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue