Skip to content

Commit

Permalink
fix: comming games
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed May 6, 2023
1 parent d9bfff1 commit e27a959
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/GZCTF/Repositories/GameRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public string GetToken(Game game, Team team)
=> context.Games.FirstOrDefaultAsync(x => x.Id == id, token);

public Task<int[]> GetUpcomingGames(CancellationToken token = default)
=> context.Games.Where(g => g.StartTimeUTC - DateTime.UtcNow < TimeSpan.FromMinutes(5))
=> context.Games.Where(g => g.StartTimeUTC > DateTime.UtcNow
&& g.StartTimeUTC - DateTime.UtcNow < TimeSpan.FromMinutes(5))
.OrderBy(g => g.StartTimeUTC).Select(g => g.Id).ToArrayAsync(token);

public async Task<BasicGameInfoModel[]> GetBasicGameInfo(int count = 10, int skip = 0, CancellationToken token = default)
Expand Down

0 comments on commit e27a959

Please sign in to comment.