chore: PacketDistributorService disposable

This commit is contained in:
Timothy Schenk 2023-11-25 14:31:30 +01:00
parent 81646f4501
commit 1cdff7f0be

View file

@ -23,7 +23,7 @@ namespace Server.Services;
using static CodeGenerator;
using static ExpressionBuilder;
public class PacketDistributorService : IHostedService
public class PacketDistributorService : IHostedService, IDisposable
{
private readonly ConcurrentQueue<RawPacket> _concurrentQueue;
@ -178,4 +178,10 @@ public class PacketDistributorService : IHostedService
_logger.PacketData(JsonConvert.SerializeObject(packet));
_logger.PacketFinished(item.Session.Id, item.OperationCode);
}
public void Dispose()
{
GC.SuppressFinalize(this);
_activitySource.Dispose();
}
}