Skip to content

Commit

Permalink
fix league revalidate error. delete Genzy case
Browse files Browse the repository at this point in the history
  • Loading branch information
sipec committed Jul 11, 2024
1 parent 085253e commit 7ae27ab
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions backend/scheduler/src/jobs/update-league.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function updateLeague() {
contracts.creator_id as user_id,
'CREATOR_FEE' as category,
sum((cb.data->'fees'->>'creatorFee')::numeric) as amount
from contract_bets cb
from contract_bets cb
join contracts on contracts.id = cb.contract_id
where
cb.created_time > millis_to_ts($2)
Expand Down Expand Up @@ -123,15 +123,6 @@ export async function updateLeague() {
'user_id'
)

// Set Genzy's referral mana to 0.
const GENZY_USER_ID = 'cA1JupYR5AR8btHUs2xvkui7jA93'
const genzyManaEarned = amountByUserId[GENZY_USER_ID]
if (genzyManaEarned) {
genzyManaEarned
.filter((a) => a.category === 'REFERRAL')
.forEach((a) => (a.amount = 0))
}

const manaEarnedUpdates = []
for (const [userId, manaEarned] of Object.entries(amountByUserId)) {
const keys = manaEarned.map((a) => a.category)
Expand All @@ -150,7 +141,6 @@ export async function updateLeague() {
console.log('Mana earned updates', manaEarnedUpdates.length)

await bulkUpdate(pg, 'leagues', ['user_id', 'season'], manaEarnedUpdates)
await revalidateStaticProps('/leagues')
log('Done.')
}

Expand Down

0 comments on commit 7ae27ab

Please sign in to comment.