mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 13:36:50 +01:00
A bunch of additional logging in pursuit of #1713
This commit is contained in:
@@ -369,6 +369,8 @@ namespace Tgstation.Server.Host.Jobs
|
||||
|
||||
var hubUpdatesTask = Task.CompletedTask;
|
||||
var result = false;
|
||||
var firstLogHappened = false;
|
||||
var hubGroupName = JobsHub.HubGroupName(job);
|
||||
|
||||
Stopwatch stopwatch = null;
|
||||
void QueueHubUpdate(JobResponse update, bool final)
|
||||
@@ -380,10 +382,16 @@ namespace Tgstation.Server.Host.Jobs
|
||||
{
|
||||
await currentUpdatesTask;
|
||||
|
||||
if (!firstLogHappened)
|
||||
{
|
||||
logger.LogTrace("Sending updates for job {id} to hub group {group}", update.Id.Value, hubGroupName);
|
||||
firstLogHappened = true;
|
||||
}
|
||||
|
||||
// DCT: Cancellation token is for job, operation should always run
|
||||
await hub
|
||||
.Clients
|
||||
.Group(JobsHub.HubGroupName(job))
|
||||
.Group(hubGroupName)
|
||||
.ReceiveJobUpdate(update, CancellationToken.None);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,8 @@ namespace Tgstation.Server.Host.Jobs
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(authenticationContext);
|
||||
|
||||
logger.LogTrace("MapConnectionGroups UID: {uid}", authenticationContext.User.Id.Value);
|
||||
|
||||
List<long> permedInstanceIds = null;
|
||||
await databaseContextFactory.UseContext(
|
||||
async databaseContext =>
|
||||
|
||||
@@ -85,9 +85,17 @@ namespace Tgstation.Server.Host.Utils.SignalR
|
||||
|
||||
var mappingTask = OnConnectionMapGroups?.Invoke(
|
||||
authenticationContext,
|
||||
mappedGroups => Task.WhenAll(
|
||||
mappedGroups.Select(
|
||||
group => hub.Groups.AddToGroupAsync(context.ConnectionId, group, cancellationToken))),
|
||||
mappedGroups =>
|
||||
{
|
||||
mappedGroups = mappedGroups.ToList();
|
||||
logger.LogTrace(
|
||||
"Mapping connection ID {connectionId} with groups: {mappedGroups}",
|
||||
context.ConnectionId,
|
||||
String.Join(", ", mappedGroups));
|
||||
return Task.WhenAll(
|
||||
mappedGroups.Select(
|
||||
group => hub.Groups.AddToGroupAsync(context.ConnectionId, group, cancellationToken)));
|
||||
},
|
||||
cancellationToken)
|
||||
?? ValueTask.CompletedTask;
|
||||
userConnections.AddOrUpdate(
|
||||
|
||||
Reference in New Issue
Block a user