diff --git a/lib/leaderboard/denokv/denokv_leaderboard_client.ts b/lib/leaderboard/denokv/denokv_leaderboard_client.ts index dc21e17..6d506fb 100644 --- a/lib/leaderboard/denokv/denokv_leaderboard_client.ts +++ b/lib/leaderboard/denokv/denokv_leaderboard_client.ts @@ -69,15 +69,9 @@ export class DenoKvLeaderboardClient implements LeaderboardClient { /** * updateLatestSeason updates the latest season in Deno KV. */ - private async updateLatestSeason( - season: api.Season, - prevSeasonResult: Deno.KvEntryMaybe | null, - ): Promise { + private async updateLatestSeason(season: api.Season): Promise { // Update the season. const updateSeasonOp = this.kv.atomic(); - if (prevSeasonResult) { - updateSeasonOp.check(prevSeasonResult); - } // Update the season. const updateSeasonResult = await updateSeasonOp.set( @@ -183,7 +177,7 @@ export class DenoKvLeaderboardClient implements LeaderboardClient { // Update the season if it is the latest season. startOfWeekDate.getTime() === seasonStartDate.getTime(); if (isLatestSeason) { - await this.updateLatestSeason(season, seasonResult); + await this.updateLatestSeason(season); } // Return a sync response.