Skip to content
Snippets Groups Projects
Commit c2e995b8 authored by Jake Taylor's avatar Jake Taylor
Browse files

cleanup round result

parent a41845ff
No related branches found
No related tags found
1 merge request!510Release
...@@ -135,28 +135,18 @@ func (c *client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -135,28 +135,18 @@ func (c *client) getRoundResults(roundList []id.Round, timeout time.Duration,
} }
} }
} }
historicalRoundsCh := make(chan RoundResult, len(historicalRequest))
// Find out what happened to old (historical) rounds if any are needed // Find out what happened to old (historical) rounds if any are needed
if len(historicalRequest) > 0 { if len(historicalRequest) > 0 {
for _, rnd := range historicalRequest { for _, rnd := range historicalRequest {
rrc := func(round rounds.Round, success bool) { rrc := func(round rounds.Round, success bool) {
var status RoundLookupStatus result := ds.EventReturn{
if success { RoundInfo: round.Raw,
status = Succeeded TimedOut: success,
} else {
status = TimeOut
}
historicalRoundsCh <- RoundResult{
Status: status,
Round: round,
}
}
err := c.Retriever.LookupHistoricalRound(rnd, rrc)
if err != nil {
historicalRoundsCh <- RoundResult{
Status: TimeOut,
} }
sendResults <- result
} }
_ = c.Retriever.LookupHistoricalRound(rnd, rrc)
} }
} }
...@@ -181,8 +171,6 @@ func (c *client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -181,8 +171,6 @@ func (c *client) getRoundResults(roundList []id.Round, timeout time.Duration,
case <-timer.C: case <-timer.C:
roundCallback(false, true, roundsResults) roundCallback(false, true, roundsResults)
return return
case result = <-historicalRoundsCh:
hasResult = true
case roundReport := <-sendResults: case roundReport := <-sendResults:
numResults-- numResults--
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment