Skip to content

Commit

Permalink
fixup! fix typos + add log
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos committed Dec 13, 2023
1 parent fc38307 commit 19b025e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export default class Spark {
})
await assertOkResponse(res, 'Failed to fetch the current SPARK round')
this.#activity.onHealthy()
const { retrievalTasks, maxTaskPerNode, ...round } = await res.json()
const { retrievalTasks, maxTasksPerNode, ...round } = await res.json()
console.log('Current SPARK round:', round)
console.log(' %s max tasks per node', maxTaskPerNode ?? '<n/a>')
console.log(' %s max tasks per node', maxTasksPerNode ?? '<n/a>')
console.log(' %s retrieval tasks', retrievalTasks.length)
if (maxTaskPerNode) this.#maxTasksPerNode = maxTaskPerNode
if (maxTasksPerNode) this.#maxTasksPerNode = maxTasksPerNode

const retrieval = retrievalTasks[Math.floor(Math.random() * retrievalTasks.length)]
console.log({ retrieval })
Expand Down Expand Up @@ -180,6 +180,7 @@ export default class Spark {
const baseDelay = APPROX_ROUND_LENGTH_IN_MS / this.#maxTasksPerNode
const delay = baseDelay - duration
if (delay > 0) {
console.log('Sleeping for %s seconds before starting the next task...', Math.round(delay/1000))
await sleep(delay)
}
}
Expand Down

0 comments on commit 19b025e

Please sign in to comment.