I forgor.
This commit is contained in:
parent
e760e6bd38
commit
007433844b
|
@ -38,6 +38,7 @@ export default async function postTasks() {
|
|||
log("Done!")
|
||||
|
||||
log("Processing points for players...")
|
||||
const totalPlayers = await Player.find({}).count()
|
||||
let processedPlayerPoints = 0
|
||||
for (const entry of cache.pointsRanks) {
|
||||
spread(
|
||||
|
@ -49,7 +50,7 @@ export default async function postTasks() {
|
|||
).then(
|
||||
() => {
|
||||
++processedPlayerPoints
|
||||
log(`Processed player ${processedPlayerPoints}/${cache.pointsRanks.length} -> «${entry[0]}» has ${entry[1]} points!`)
|
||||
log(`Processed player ${processedPlayerPoints}/${totalPlayers} -> «${entry[0]}» has ${entry[1]} points!`)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -61,7 +62,7 @@ export default async function postTasks() {
|
|||
'./playerRankPoints.js',
|
||||
{
|
||||
name: entry[0],
|
||||
rankPoints: [1]
|
||||
rankPoints: entry[1]
|
||||
}
|
||||
).then(
|
||||
() => {
|
||||
|
|
|
@ -60,7 +60,7 @@ export function initWorkers(threads) {
|
|||
|
||||
setInterval(
|
||||
scheduler,
|
||||
50
|
||||
process.env.SCHEDULE_TIME ?? 50
|
||||
)
|
||||
|
||||
log(`Initialised the scheduler!`)
|
||||
|
|
|
@ -10,6 +10,8 @@ const Player = new mongoose.Schema({
|
|||
firstFinish: Date
|
||||
})
|
||||
|
||||
Player.index({ name: 1 })
|
||||
|
||||
/**
|
||||
* This cotains the mongoose 'Player' model.
|
||||
* @module schemas/Player
|
||||
|
|
Loading…
Reference in New Issue
Block a user