Skip to content

Commit

Permalink
I love validation
Browse files Browse the repository at this point in the history
Signed-off-by: Ayase Minori <[email protected]>
  • Loading branch information
sr229 committed Apr 18, 2024
1 parent e702f59 commit f6d2520
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/updateContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,17 @@ const asdf = async () => {

setData(client, newData)
} else {
const parsed: cache = JSON.parse(data)

if (Date.now() - parsed.timestamp > 3600000) {
if (Date.now() - JSON.parse(JSON.stringify(data)).timestamp > 3600000) {
const newData = await fetchData()
setData(client, newData)
}
}
}
asdf()

try {
await asdf()
console.log("Successfully hydrated contributors.")
} catch (e: any) {
throw new Error(`Unable to hydrate contributors: ${e}\n${e.stack}`)
}

0 comments on commit f6d2520

Please sign in to comment.