Fix: buildable

This commit is contained in:
Grail Finder
2025-07-02 15:51:14 +03:00
parent 9973546aad
commit 3e0d24f5f8
7 changed files with 110 additions and 105 deletions

View File

@ -1,6 +1,7 @@
package handlers
import (
"context"
"fmt"
"gralias/models"
"sync"
@ -35,7 +36,7 @@ func StartTurnTimer(roomID string, duration time.Duration) {
case <-done:
return
case <-ticker.C:
room, err := getRoomByID(roomID)
room, err := repo.RoomGetByID(context.Background(), roomID)
if err != nil {
log.Error("failed to get room by id", "error", err)
StopTurnTimer(roomID)
@ -45,7 +46,7 @@ func StartTurnTimer(roomID string, duration time.Duration) {
log.Info("turn time is over", "room_id", roomID)
room.ChangeTurn()
room.MimeDone = false
if err := saveRoom(room); err != nil {
if err := repo.RoomUpdate(context.Background(), room); err != nil {
log.Error("failed to save room", "error", err)
}
notify(models.NotifyTurnTimerPrefix+room.ID, fmt.Sprintf("%d", room.Settings.TurnSecondsLeft))
@ -72,4 +73,3 @@ func StopTurnTimer(roomID string) {
delete(timers, roomID)
}
}