Skip to content

Commit

Permalink
updated leaderboard saving
Browse files Browse the repository at this point in the history
  • Loading branch information
sarge1989 committed May 7, 2024
1 parent f3af0a7 commit 003b46a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion functions/src/definitions/batchJobs/batchJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ async function saveLeaderboard() {
try {
const leaderboardData = await getFullLeaderboard()
const storageBucket = admin.storage().bucket()
const leaderboardFile = storageBucket.file("leaderboard.json")
//get date string
const date = new Date();
const dateString = date.toISOString().split('T')[0];
const leaderboardFile = storageBucket.file(`leaderboard_${dateString}.json`)

await leaderboardFile.save(JSON.stringify(leaderboardData), {
contentType: "application/json",
Expand Down

0 comments on commit 003b46a

Please sign in to comment.