Skip to content

Commit

Permalink
Tweak interval
Browse files Browse the repository at this point in the history
  • Loading branch information
jjxtra committed Oct 24, 2020
1 parent 58999b2 commit 2c3a521
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion IPBanCore/Core/IPBan/IPBanConfigReaderWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class IPBanConfigReaderWriter
private string localConfigString;
private static string lastConfigValue;
private static DateTime lastConfigWriteTime;
private static DateTime lastConfigIntervalTime;

private static readonly TimeSpan forceLoadInterval = TimeSpan.FromMinutes(5.0);

Expand Down Expand Up @@ -116,10 +117,11 @@ await Locker.LockActionAsync(async () =>

// if enough time has elapsed, force a reload anyway, in case of dns entries and the
// like in the config that need to be re-resolved
IPBanService.UtcNow - lastWriteTime > forceLoadInterval)
IPBanService.UtcNow - lastConfigIntervalTime > forceLoadInterval)
{
lastConfigWriteTime = lastWriteTime;
lastConfigValue = currentConfig;
lastConfigIntervalTime = IPBanService.UtcNow;
result = currentConfig;
}
});
Expand Down

0 comments on commit 2c3a521

Please sign in to comment.