refactor: only pass shard ID to event handlers instead of full shard object

This commit is contained in:
spiral 2022-01-14 18:39:03 -05:00
parent bf80dd0988
commit 50a24f03a7
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
13 changed files with 74 additions and 70 deletions

View file

@ -20,9 +20,9 @@ public class SerilogGatewayEnricherFactory
_botConfig = botConfig;
}
public async Task<ILogEventEnricher> GetEnricher(Shard shard, IGatewayEvent evt)
public async Task<ILogEventEnricher> GetEnricher(int shardId, IGatewayEvent evt)
{
var props = new List<LogEventProperty> { new("ShardId", new ScalarValue(shard.ShardId)) };
var props = new List<LogEventProperty> { new("ShardId", new ScalarValue(shardId)) };
if (_botConfig.Cluster != null)
props.Add(new LogEventProperty("ClusterId", new ScalarValue(_botConfig.Cluster.NodeName)));