Feat: graceful shutdown

This commit is contained in:
Grail Finder
2025-06-15 09:51:25 +03:00
parent fa25679624
commit 30e322d9c6
6 changed files with 153 additions and 18 deletions

View File

@ -70,10 +70,11 @@ func getStateByCtx(ctx context.Context) (*models.UserState, error) {
}
func saveFullInfo(fi *models.FullInfo) error {
// INFO: unfortunately working no transactions; so case are possible where first object is updated but the second is not
// INFO: no transactions; so case is possible where first object is updated but the second is not
if err := saveState(fi.State.Username, fi.State); err != nil {
return err
}
log.Debug("saved user state", "state", fi.State)
if err := saveRoom(fi.Room); err != nil {
return err
}