Skip to content

Commit

Permalink
fix(cornjob): fix wrong trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
kengwang committed Aug 30, 2024
1 parent 9f2d889 commit 470a91d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/GZCTF/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"applicationUrl": "http://localhost:55000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy",
"ConnectionStrings__Database": "Host=127.0.0.1:5432;Database=gzctf;Username=postgres;Password=123456"
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
}
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/GZCTF/Services/CronJobService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,21 @@ async Task UpdateChallengeStatus(AsyncServiceScope scope)
await challengesRepository.EnsureInstances(gameChallenge, game);
if (game.IsActive)
await gameNoticeRepository.AddNotice(
new() { Game = game, Type = NoticeType.NewChallenge, Values = [gameChallenge.Title] });
await cacheHelper.FlushScoreboardCache(game.Id, CancellationToken.None);
new() { Game = game, Type = NoticeType.NewChallenge, Values = [gameChallenge.Title] });
}

if (!gameChallenge.IsEnabled)
continue;

if (gameChallenge.EndAt <= DateTimeOffset.Now)
{
gameChallenge.CanSubmit = false;
}

}
await cacheHelper.FlushScoreboardCache(game.Id, CancellationToken.None);
}

await gamesRepository.SaveAsync();
}

private int _counter = 6;
int _counter;

async void Execute(object? state)
{
Expand Down

0 comments on commit 470a91d

Please sign in to comment.