job status reporter
This commit is contained in:
@@ -36,14 +36,14 @@ var config = new EpsonPrintServiceConfiguration
|
||||
Console.WriteLine($"Restaurant: {config.RestaurantId}");
|
||||
Console.WriteLine($"API URL: {config.ApiUrl}");
|
||||
|
||||
//kernel.Bind<IDiscoveryService>().To<DiscoveryService>().InSingletonScope();
|
||||
kernel.Bind<IDiscoveryService>().To<DiscoveryService>().InSingletonScope();
|
||||
|
||||
var discovery = new PreconfiguredDiscoveryService();
|
||||
discovery.AddPrinter("192.168.50.176", "TM-T30III", port: 9100);
|
||||
discovery.AddPrinter("192.168.50.60", "TM-T30III", port: 9100);
|
||||
discovery.AddPrinter("192.168.50.61", "TM-T30III", port: 9100);
|
||||
discovery.AddPrinter("192.168.50.80", "TM-U220II", port: 9100);
|
||||
kernel.Bind<IDiscoveryService>().ToConstant(discovery);
|
||||
//var discovery = new PreconfiguredDiscoveryService();
|
||||
//discovery.AddPrinter("192.168.50.176", "TM-T30III", port: 9100);
|
||||
//discovery.AddPrinter("192.168.50.60", "TM-T30III", port: 9100);
|
||||
//discovery.AddPrinter("192.168.50.61", "TM-T30III", port: 9100);
|
||||
//discovery.AddPrinter("192.168.50.80", "TM-U220II", port: 9100);
|
||||
//kernel.Bind<IDiscoveryService>().ToConstant(discovery);
|
||||
|
||||
kernel.Bind<HttpClient>().ToConstant(new HttpClient { Timeout = TimeSpan.FromSeconds(30) }).InSingletonScope();
|
||||
|
||||
@@ -85,7 +85,7 @@ var heartbeatTask = kernel.Get<HeartbeatBackgroundTask>();
|
||||
//printServer.RegisterPrinter("10.0.20.12");
|
||||
|
||||
|
||||
await printLoop.StartAsync();
|
||||
|
||||
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
@@ -100,6 +100,12 @@ Console.CancelKeyPress += (sender, e) =>
|
||||
_ = discoveryTask.StartAsync(cts.Token);
|
||||
_ = heartbeatTask.StartAsync(cts.Token);
|
||||
|
||||
// delay for a moment to allow discovery to find printers
|
||||
Console.WriteLine("Waiting for printer discovery...");
|
||||
await Task.Delay(3000);
|
||||
|
||||
await printLoop.StartAsync();
|
||||
|
||||
try
|
||||
{
|
||||
await Task.Delay(Timeout.Infinite, cts.Token);
|
||||
|
||||
Reference in New Issue
Block a user