Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Jul 1, 2024
1 parent 0692d01 commit 3d7aa79
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/dota/src/db/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,6 @@ class SetupSupabase {
client.stream_start_date = newObj.stream_start_date
}

async function handler() {
if (!client) return

const deets = await getRankDetail(newObj.mmr, client.steam32Id)
server.io.to(client.token).emit('update-medal', deets)
}

// dont overwrite with 0 because we use this variable to track currently logged in mmr
if (newObj.mmr !== 0 && client.mmr !== newObj.mmr && oldObj.mmr !== newObj.mmr) {
client.mmr = newObj.mmr
Expand All @@ -180,7 +173,8 @@ class SetupSupabase {
mmr: newObj.mmr,
})
try {
void handler()
const deets = await getRankDetail(newObj.mmr, client.steam32Id)
server.io.to(client.token).emit('update-medal', deets)
} catch (e) {
logger.error('Error in watcher postgres update', { e })
}
Expand Down

0 comments on commit 3d7aa79

Please sign in to comment.