DnsWebService: fixed issue in StartAsync() that cause not loading block lists when update interval is set to 0.

This commit is contained in:
Shreyas Zare
2023-05-20 18:10:40 +05:30
parent aa950351c0
commit ba0fc9be62

View File

@@ -2230,14 +2230,13 @@ namespace DnsServerCore
_dnsServer.BlockedZoneManager.LoadBlockedZoneFile();
//load block list zone async
if ((_settingsApi.BlockListUpdateIntervalHours > 0) && (_dnsServer.BlockListZoneManager.BlockListUrls.Count > 0))
if (_dnsServer.BlockListZoneManager.BlockListUrls.Count > 0)
{
ThreadPool.QueueUserWorkItem(delegate (object state)
{
try
{
_dnsServer.BlockListZoneManager.LoadBlockLists();
_settingsApi.StartBlockListUpdateTimer();
}
catch (Exception ex)
{
@@ -2246,6 +2245,9 @@ namespace DnsServerCore
});
}
if (_settingsApi.BlockListUpdateIntervalHours > 0)
_settingsApi.StartBlockListUpdateTimer();
//load dns cache async
if (_saveCache)
{