From 40d405f318a109aad5e7de7ad71fedcc04bb0e86 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 15 Jul 2026 02:23:59 -0500 Subject: fix(cache): correct max-size megabyte conversion max-size is documented in SETUP.md as megabytes, but the conversion was `*= 1024 ^ 2`. In Go `^` is XOR, not exponentiation, so this multiplied by 1026 rather than 1048576 -- a configured max-size of 200 produced a ~205 KB cap instead of 200 MB, wiping the cache almost immediately. This changes runtime behaviour: the cache will now grow to the size the config actually asks for. --- app/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/config.go b/app/config.go index 2d32d19..acd9b71 100755 --- a/app/config.go +++ b/app/config.go @@ -88,7 +88,9 @@ func ExecuteConfig() { lifetimeParsed = duration * int64(num) } - CFG.Cache.MaxSize *= 1024 ^ 2 + // max-size is documented in megabytes. This was 1024^2, which in Go is + // XOR (1026), not exponentiation — so the cap was ~1000x too small. + CFG.Cache.MaxSize *= 1024 * 1024 go InitCacheSystem() } -- cgit v1.2.3