Enha: remove bot without room

This commit is contained in:
Grail Finder
2025-07-06 12:57:02 +03:00
parent a38472a685
commit e84941d593
5 changed files with 46 additions and 12 deletions

View File

@ -96,7 +96,6 @@ func (cm *CronManager) CleanupRooms() {
}
}
}
// If the creator is not in the room or the room is inactive, it's time to delete
if !creatorInRoom || isInactive {
reason := "creator left"
@ -107,7 +106,7 @@ func (cm *CronManager) CleanupRooms() {
for _, player := range players {
if player.IsBot {
if err := cm.repo.PlayerDelete(ctx, room.ID, player.Username); err != nil {
if err := cm.repo.PlayerDelete(ctx, room.ID); err != nil {
cm.log.Error("failed to delete bot player", "room_id", room.ID, "username", player.Username, "err", err)
}
} else {