Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
LordCasser committed Aug 10, 2022
1 parent 3cf5920 commit fceba48
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions server/services/database/resolvers/gameEvent.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ func AddEvent(eventAction int, eventTime time.Time) bool {
Time: eventTime,
Action: uint64(eventAction),
}
//log.Println("eventAction: ", eventAction)
result := db.Create(&event)
if result.Error != nil {
log.Println(result.Error)
Expand Down Expand Up @@ -78,21 +77,18 @@ func IsGameRunning(outsideTX *gorm.DB) bool {
var currentEvent entity.GameEvent
result := outsideTX.Where(outsideTX.Where(map[string]interface{}{"action": entity.PauseEvent}).Or(map[string]interface{}{"action": entity.ResumeEvent}))
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
log.Println("empty")
return true
} else if result.Error != nil {
log.Println(result.Error)
return false
}
result = result.Where("time <= ?", currentTime).Order("time desc").First(&currentEvent)
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
log.Println("2nd empty")
return false
} else if result.Error != nil {
log.Println(result.Error)
return false
}
log.Println("currentEvent", currentEvent.Action)
if currentEvent.Action == entity.ResumeEvent {
return true
} else {
Expand Down

0 comments on commit fceba48

Please sign in to comment.