emit insin telemetry for job outcomes in PrinterQueue

This commit is contained in:
EugeneTes
2026-07-23 08:03:32 +00:00
parent 050616b595
commit e70126be2b
2 changed files with 27 additions and 4 deletions

View File

@@ -8,18 +8,19 @@ public class PrintServer
private readonly IPrintService _printService;
private readonly ILogger _logger;
private readonly IJobStatusReporter _statusReporter;
private readonly Inspectron.Epson.PrintServer.Telemetry.IInsinTelemetry _telemetry;
private readonly ConcurrentDictionary<string, PrinterQueue> _printerQueues;
private readonly SemaphoreSlim _printDiscoveryLock = new(1, 1);
private int _readerCount = 0;
private readonly object _readerCountLock = new();
public PrintServer(IPrintService printService, ILogger logger, IJobStatusReporter statusReporter)
public PrintServer(IPrintService printService, ILogger logger, IJobStatusReporter statusReporter, Inspectron.Epson.PrintServer.Telemetry.IInsinTelemetry telemetry)
{
_printService = printService;
_logger = logger;
_statusReporter = statusReporter;
_telemetry = telemetry;
_printerQueues = new ConcurrentDictionary<string, PrinterQueue>();
}
/// <summary>
@@ -80,7 +81,7 @@ public class PrintServer
public void RegisterPrinter(string printerIp)
{
var queue = new PrinterQueue(printerIp, _printService, _logger, this, _statusReporter);
var queue = new PrinterQueue(printerIp, _printService, _logger, this, _statusReporter, _telemetry);
if (_printerQueues.TryAdd(printerIp, queue))
{
queue.Start();