Skip to content

Commit

Permalink
shorten emote cache period
Browse files Browse the repository at this point in the history
  • Loading branch information
broadeditz committed Nov 23, 2023
1 parent 6090dce commit 996567f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/loaders/emote.loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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),
}
}

Expand Down

0 comments on commit 996567f

Please sign in to comment.