This commit is contained in:
2025-04-03 21:25:23 +02:00
parent 88c298787a
commit 9163c453af
13 changed files with 721 additions and 282 deletions

View File

@@ -0,0 +1,27 @@
import { LeaderboardService } from '@/server/services/leaderboard'
import { RANKED_CHANNEL, VANILLA_CHANNEL } from '@/shared/constants'
const CHANNEL_IDS = [RANKED_CHANNEL, VANILLA_CHANNEL]
async function refresh() {
const service = new LeaderboardService()
for (const channelId of CHANNEL_IDS) {
try {
console.log(`refreshing leaderboard for ${channelId}...`)
await service.refreshLeaderboard(channelId)
} catch (err) {
console.error(`failed to refresh ${channelId}:`, err)
}
}
}
// run if called directly
if (require.main === module) {
refresh()
.then(() => process.exit(0))
.catch((err) => {
console.error('refresh failed:', err)
process.exit(1)
})
}