commit 941cc1bdfb0f37cd62e4a7b5a362f077d3540061 parent d25d358595d5f157ff188f746eb4e65db8f1fa59 Author: n0tr1v <n0tr1v@protonmail.com> Date: Sat, 28 Jan 2023 13:39:24 -0800 add doc Diffstat:
| M | pkg/global/global.go | | | 4 | ++++ |
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/pkg/global/global.go b/pkg/global/global.go @@ -8,6 +8,10 @@ import ( var notifCountCache = cache.NewWithKey[string, int64](30*time.Second, time.Minute) +// Notifications count cache has to be set per user session. +// Each session can have a different notif count. +// This is due to the fact that we notify other sessions of new successful +// logins on the user account. func cacheKey(userID database.UserID, sessionToken string) string { return userID.String() + "_" + sessionToken }