discount
This commit is contained in:
@@ -44,6 +44,10 @@ public class PrinterDiscoveryBackgroundTask
|
||||
// Run immediately on start
|
||||
await DiscoverAndNotifyAsync();
|
||||
|
||||
// Scan once for now, then exit
|
||||
// By Reini, because we are loosing connection on frequent scans
|
||||
return;
|
||||
|
||||
// Then run periodically
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,15 @@ 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);
|
||||
|
||||
kernel.Bind<HttpClient>().ToConstant(new HttpClient { Timeout = TimeSpan.FromSeconds(30) }).InSingletonScope();
|
||||
|
||||
|
||||
@@ -65,6 +73,9 @@ kernel.Bind<HeartbeatBackgroundTask>().ToSelf().InSingletonScope();
|
||||
|
||||
var printLoop = kernel.Get<PrintLoop>();
|
||||
var printServer = kernel.Get<PrintServer>();
|
||||
|
||||
|
||||
|
||||
var discoveryTask = kernel.Get<PrinterDiscoveryBackgroundTask>();
|
||||
var heartbeatTask = kernel.Get<HeartbeatBackgroundTask>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user