dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 14a3d40f06524291ba85748447dc8307320b067a
parent 83f30973aa4f19989a3b8149e3414a432dddb53f
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed, 31 May 2023 04:27:20 -0700

better timer for chess cleaner thread

Diffstat:
Mpkg/web/handlers/api/v1/chess.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/api/v1/chess.go b/pkg/web/handlers/api/v1/chess.go @@ -77,10 +77,10 @@ func NewChess(db *database.DkfDB) *Chess { // Thread that cleanup inactive games go func() { for { - time.Sleep(time.Minute) + time.Sleep(15 * time.Minute) c.Lock() for k, g := range c.games { - if time.Since(g.lastUpdated) > 30*time.Minute { + if time.Since(g.lastUpdated) > 1*time.Hour { delete(c.games, k) } }