Ship without touching prod and with some logs.
This commit is contained in:
parent
8e1ae2b7ff
commit
6b96b1d6a1
|
@ -57,6 +57,7 @@ export async function updateMetricsCore() {
|
|||
|
||||
const now = Date.now()
|
||||
const betsByContract = groupBy(bets, (bet) => bet.contractId)
|
||||
|
||||
const contractUpdates = contracts
|
||||
.filter((contract) => contract.id)
|
||||
.map((contract) => {
|
||||
|
@ -179,6 +180,7 @@ export async function updateMetricsCore() {
|
|||
)
|
||||
log(`Updated metrics for ${users.length} users.`)
|
||||
|
||||
try {
|
||||
const groupUpdates = groups.map((group, index) => {
|
||||
const groupContractIds = contractsByGroup[index] as GroupContractDoc[]
|
||||
const groupContracts = groupContractIds.map(
|
||||
|
@ -204,7 +206,12 @@ export async function updateMetricsCore() {
|
|||
},
|
||||
}
|
||||
})
|
||||
await writeAsync(firestore, groupUpdates)
|
||||
// Shipping without this for now to check it's working as intended
|
||||
console.log('Group Leaderboard Updates', groupUpdates)
|
||||
//await writeAsync(firestore, groupUpdates)
|
||||
} catch (e) {
|
||||
console.log('Error While Updating Group Leaderboards', e)
|
||||
}
|
||||
}
|
||||
|
||||
const topUserScores = (scores: { [userId: string]: number }) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user