do not discover while printing
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.0.4</Version>
|
||||
<Version>1.0.5</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -67,10 +67,11 @@ public class PrinterDiscoveryBackgroundTask
|
||||
|
||||
private async Task DiscoverAndNotifyAsync()
|
||||
{
|
||||
_printServer.EnterDiscoveryLock();
|
||||
try
|
||||
{
|
||||
var printers = await _discoveryService.DiscoverPrintersAsync(_discoveryTimeout);
|
||||
|
||||
|
||||
var currentIps = printers.Select(p => p.IPAddress).ToHashSet();
|
||||
|
||||
foreach (string currentIp in currentIps)
|
||||
@@ -90,6 +91,10 @@ public class PrinterDiscoveryBackgroundTask
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to discover printers");
|
||||
}
|
||||
finally
|
||||
{
|
||||
_printServer.ExitDiscoveryLock();
|
||||
}
|
||||
}
|
||||
|
||||
private bool HasConfigurationChanged(HashSet<string> currentIps)
|
||||
|
||||
Reference in New Issue
Block a user