Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync old season before beginning new season #55

Merged
merged 2 commits into from
Dec 7, 2023
Merged

Conversation

EthanThatOneKid
Copy link
Contributor

Background

#53 describes a bug in which the final day is not being properly recorded before beginning the new season.

Intends to resolve #53.

Relevant code

if (!isPresentAndLatest && seasonResult?.value) {
// Sync old season.
const players = await this.listPlayers();
const oldSeason = await sync({
lcClient: this.lc,
players,
season: seasonResult.value,
});
oldSeason.synced_at = referenceDate.toUTCString();
// Store the synced old season.
await this.kv.set(
[LeaderboardKvPrefix.SEASONS, oldSeason.id],
oldSeason,
);
}

Copy link
Contributor

@tomasohCHOM tomasohCHOM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if I am the most suitable person to approve this change, but so far it looks like the logic plays out, LGTM!

@EthanThatOneKid EthanThatOneKid merged commit bf61bf1 into main Dec 7, 2023
5 checks passed
@EthanThatOneKid EthanThatOneKid deleted the fix/53 branch December 7, 2023 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Last day doesn't seem to be recording
2 participants