WebServiceSettingsApi: updated ResporeSettingsAsync() to fix issue of not loading block list when update interval is set to 0.

This commit is contained in:
Shreyas Zare
2023-05-20 18:11:48 +05:30
parent ba0fc9be62
commit baefbd720e

View File

@@ -1550,14 +1550,13 @@ namespace DnsServerCore
//reload settings and block list zone
_dnsWebService.LoadConfigFile();
if ((_blockListUpdateIntervalHours > 0) && (_dnsWebService.DnsServer.BlockListZoneManager.BlockListUrls.Count > 0))
if (_dnsWebService.DnsServer.BlockListZoneManager.BlockListUrls.Count > 0)
{
ThreadPool.QueueUserWorkItem(delegate (object state)
{
try
{
_dnsWebService.DnsServer.BlockListZoneManager.LoadBlockLists();
StartBlockListUpdateTimer();
}
catch (Exception ex)
{
@@ -1565,10 +1564,11 @@ namespace DnsServerCore
}
});
}
if (_blockListUpdateIntervalHours > 0)
StartBlockListUpdateTimer();
else
{
StopBlockListUpdateTimer();
}
}
if (apps)