mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-31 00:50:45 +01:00
Fix the chat handler crashing
This commit is contained in:
@@ -238,18 +238,25 @@ namespace Tgstation.Server.Host.Components.Chat
|
||||
//wait for a message
|
||||
await Task.WhenAny(messageTasks.Select(x => x.Value)).ConfigureAwait(false);
|
||||
|
||||
//process completed ones
|
||||
var toRemove = new List<IProvider>();
|
||||
//process completed ones
|
||||
foreach (var I in messageTasks.Where(x => x.Value.IsCompleted))
|
||||
{
|
||||
messageTasks.Remove(I.Key);
|
||||
|
||||
var message = await I.Value.ConfigureAwait(false);
|
||||
|
||||
await ProcessMessage(I.Key, message, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
toRemove.Add(I.Key);
|
||||
}
|
||||
foreach (var I in toRemove)
|
||||
messageTasks.Remove(I);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException) { }
|
||||
catch(Exception e)
|
||||
{
|
||||
logger.LogError("Message monitor crashed!: Exception: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -19,4 +19,6 @@ Server updates. Use FOLDERS so dependencies can be properly packaged
|
||||
|
||||
TgsAuthorize attribute |'ing doesn't work due to role names, change to params[]
|
||||
|
||||
Chat straight doesn't work, fix it
|
||||
Chat straight doesn't work, fix it
|
||||
|
||||
Don't throw arg null exceptions with null [FromBody]'s, apparently that's allowed, return bad request instead
|
||||
Reference in New Issue
Block a user