Skip to content

Commit

Permalink
fix: reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
ImSoZRious committed Mar 31, 2024
1 parent 10955df commit 8cc94a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/server/src/models/history.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class GameHistoryRepository {
}
})
})
const follow = others.map(x => Math.max(0, x - now)).reduce((acc, x) => acc + x)
const follow = others.map(x => Math.max(0, x - now)).reduce((acc, x) => acc + x, 0)
const t = (1.0 + follow * 0.001) * vote
this.logger.info({follow, others, t, now})
await this.redis.incrBy(`game::${game_id}::${key}`, (1.0 + follow * 0.001) * vote)
Expand Down

0 comments on commit 8cc94a4

Please sign in to comment.