move markuseroffline to before send offline message and db operations

This commit is contained in:
rootdarkarchon
2022-12-17 11:59:01 +01:00
parent 7231589098
commit c358b6b3c4

View File

@@ -139,12 +139,12 @@ public partial class MareHub : Hub<IMareHub>, IMareHub
_mareMetrics.DecGauge(MetricsAPI.GaugeAuthorizedConnections); _mareMetrics.DecGauge(MetricsAPI.GaugeAuthorizedConnections);
_logger.LogCallInfo(); _logger.LogCallInfo();
_clientIdentService.MarkUserOffline(AuthenticatedUserId);
await SendOfflineToAllPairedUsers(userCharaIdent).ConfigureAwait(false); await SendOfflineToAllPairedUsers(userCharaIdent).ConfigureAwait(false);
_dbContext.RemoveRange(_dbContext.Files.Where(f => !f.Uploaded && f.UploaderUID == AuthenticatedUserId)); _dbContext.RemoveRange(_dbContext.Files.Where(f => !f.Uploaded && f.UploaderUID == AuthenticatedUserId));
_clientIdentService.MarkUserOffline(AuthenticatedUserId);
await _dbContext.SaveChangesAsync().ConfigureAwait(false); await _dbContext.SaveChangesAsync().ConfigureAwait(false);
} }