Feat: room expiry

This commit is contained in:
Grail Finder
2025-06-27 12:05:55 +03:00
parent 86b1ecf82e
commit c5f04d348f
4 changed files with 19 additions and 18 deletions

View File

@ -34,6 +34,10 @@ func saveRoom(room *models.Room) error {
return err
}
memcache.Set(key, data)
// do I need last action here? since room save is kind of an action on itself
// time.Now().Add(time.Hour).Sub(room.LastActionTS)
anHour := int64(216000) // 60 * 60 * 60
memcache.Expire(key, anHour)
return nil
}