From 996567f24a415e1856d5b522b274d021e9df005a Mon Sep 17 00:00:00 2001 From: bread <75878656+broadeditz@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:56:10 +0100 Subject: [PATCH] shorten emote cache period --- internal/loaders/emote.loader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/loaders/emote.loader.go b/internal/loaders/emote.loader.go index c139d289..159f5bc3 100644 --- a/internal/loaders/emote.loader.go +++ b/internal/loaders/emote.loader.go @@ -89,7 +89,7 @@ type cachedEmote struct { } func initCache() { - for range time.Tick(time.Minute) { + for range time.Tick(30 * time.Second) { cacheMx.Lock() for k, v := range emoteCache { if time.Now().After(v.expire) { @@ -124,7 +124,7 @@ func setEmoteInCache(emote structures.Emote) { emoteCache[emote.ID] = cachedEmote{ emote: emote, - expire: time.Now().Add(time.Minute * 5), + expire: time.Now().Add(time.Minute * 2), } }