From 95022ca95b1d2792bae447d90694dcc0d67b9de2 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Thu, 16 Oct 2025 01:35:10 -0300 Subject: lower monotonic uptime resolution from MILLISECONDS to SECONDS The monotonic uptime was used exclusively with caches and having a resolution of SECONDS allows it to be stored as an int without risk of wrapping (~68 years). Using MILLISECONDS meant that it would wrap after ~25 days which is totally possible and EXPECTED. Just as an example, the small test server I ran for about 1 month had ZERO downtime on the QueryManager except for when I manually restarted it. It was probably very close to wrapping when I took it down. --- src/hostcache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hostcache.cc') diff --git a/src/hostcache.cc b/src/hostcache.cc index f32b0f7..23be08f 100644 --- a/src/hostcache.cc +++ b/src/hostcache.cc @@ -62,7 +62,7 @@ bool ResolveHostName(const char *HostName, int *OutAddr){ THostCacheEntry *Entry = NULL; int LeastRecentlyUsedIndex = 0; int LeastRecentlyUsedTime = g_CachedHostNames[0].ResolveTime; - int TimeNow = GetMonotonicUptimeMS(); + int TimeNow = GetMonotonicUptime(); for(int i = 0; i < g_Config.MaxCachedHostNames; i += 1){ THostCacheEntry *Current = &g_CachedHostNames[i]; -- cgit v1.2.3