Handle exception SubscribeAsync
This commit is contained in:
parent
597e26a1e0
commit
e92b72ceb5
|
|
@ -42,23 +42,30 @@ public class RedisSubscriber : IEventSubscriber
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (priorityEnabled)
|
try
|
||||||
{
|
{
|
||||||
if (await HandleGroupMessage(db, $"{channel}-{EventPriority.High}", group, received) > 0)
|
if (priorityEnabled)
|
||||||
{
|
{
|
||||||
continue;
|
if (await HandleGroupMessage(db, $"{channel}-{EventPriority.High}", group, received) > 0)
|
||||||
}
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (await HandleGroupMessage(db, $"{channel}-{EventPriority.Medium}", group, received) > 0)
|
if (await HandleGroupMessage(db, $"{channel}-{EventPriority.Medium}", group, received) > 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
await HandleGroupMessage(db, $"{channel}-{EventPriority.Low}", group, received);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
continue;
|
await HandleGroupMessage(db, channel, group, received);
|
||||||
}
|
}
|
||||||
|
|
||||||
await HandleGroupMessage(db, $"{channel}-{EventPriority.Low}", group, received);
|
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await HandleGroupMessage(db, channel, group, received);
|
_logger.LogError($"Error processing message: {ex.Message}\r\n{ex}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue