From e27a9593f506b0986475eaf076ddfb4b45ff3d1e Mon Sep 17 00:00:00 2001 From: GZTime Date: Sat, 6 May 2023 23:46:14 +0800 Subject: [PATCH] fix: comming games --- src/GZCTF/Repositories/GameRepository.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GZCTF/Repositories/GameRepository.cs b/src/GZCTF/Repositories/GameRepository.cs index a680a4780..82b05b84f 100644 --- a/src/GZCTF/Repositories/GameRepository.cs +++ b/src/GZCTF/Repositories/GameRepository.cs @@ -52,7 +52,8 @@ public string GetToken(Game game, Team team) => context.Games.FirstOrDefaultAsync(x => x.Id == id, token); public Task 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 GetBasicGameInfo(int count = 10, int skip = 0, CancellationToken token = default)