Feat: end turn endpoint

This commit is contained in:
Grail Finder
2025-05-08 20:04:09 +03:00
parent 3cc2ecb93d
commit 8baf03595e
7 changed files with 51 additions and 6 deletions

View File

@ -76,7 +76,7 @@ func HandleFrontLogin(w http.ResponseWriter, r *http.Request) {
state.State.Username = cleanName
// save state to cache
// if err := saveState(cleanName, state.State); err != nil {
if err := saveFullInfoByUsername(cleanName, state); err != nil {
if err := saveFullInfo(state); err != nil {
log.Error("failed to save state", "error", err)
abortWithError(w, err.Error())
return
@ -144,8 +144,8 @@ func cacheSetSession(key string, session *models.Session) error {
return err
}
memcache.Set(key, sesb)
// expire in 10 min
memcache.Expire(key, 10*60)
// TODO: to config
memcache.Expire(key, 60*60)
return nil
}