Skip to content

Commit

Permalink
fix event
Browse files Browse the repository at this point in the history
  • Loading branch information
azurity committed Aug 12, 2022
1 parent 6f5725e commit f674e19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/services/database/resolvers/gameEvent.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ func IsGameRunning(outsideTX *gorm.DB) bool {
if len(events) == 0 {
return true
}
result = result.Where("time <= ?", currentTime).Order("time desc").First(&currentEvent)
result = outsideTX.Where(
outsideTX.Where(map[string]interface{}{"action": entity.PauseEvent}).Or(map[string]interface{}{"action": entity.ResumeEvent}),
).Where("time <= ?", currentTime).Order("time desc").First(&currentEvent)
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return false
} else if result.Error != nil {
Expand Down

0 comments on commit f674e19

Please sign in to comment.