summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-15 02:23:59 -0500
committerChristian Cleberg <[email protected]>2026-07-15 02:23:59 -0500
commit40d405f318a109aad5e7de7ad71fedcc04bb0e86 (patch)
tree9ef97d5a0b01a65c5a9d32a32134a9e2acc840f2 /app
parent672ff7f44b0061e179fb33c16418738d6455a4e9 (diff)
downloadskunky-art-40d405f318a109aad5e7de7ad71fedcc04bb0e86.tar.gz
skunky-art-40d405f318a109aad5e7de7ad71fedcc04bb0e86.tar.bz2
skunky-art-40d405f318a109aad5e7de7ad71fedcc04bb0e86.zip
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.
Diffstat (limited to 'app')
-rwxr-xr-xapp/config.go4
1 files changed, 3 insertions, 1 deletions
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()
}