Skip to content

Commit

Permalink
fix: advance round before waiting for preprocess (#230)
Browse files Browse the repository at this point in the history
Fix the regression introduced by #224 where the first measurements batch
added to a new round triggers the following error:

```
Round index mismatch: 7386 !== 7387
```

Sentry issue:
https://space-meridian.sentry.io/issues/5385606165/?project=4505906069766144

Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored May 22, 2024
1 parent dbd6884 commit d35ae8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ export const startEvaluate = async ({
return
}

rounds.previous = rounds.current
rounds.current = new RoundData(roundIndex)

// TODO: Fix this properly and implement a signalling mechanism allowing the "preprocess" step
// to notify the "evaluate" when the preprocessing is done, so that we don't have to use a timer
// here. See also https://github.com/filecoin-station/spark-evaluate/issues/64
console.log(`Sleeping for ${EVALUATE_DELAY}ms before evaluating the round to let the preprocess step finish for the last batch of measurements`)
await timers.setTimeout(EVALUATE_DELAY)
console.log(`Now evaluating the round ${roundIndex}`)

rounds.previous = rounds.current
rounds.current = new RoundData(roundIndex)

// Evaluate previous round
evaluate({
round: rounds.previous,
Expand Down

0 comments on commit d35ae8f

Please sign in to comment.