Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
076d88f1
Commit
076d88f1
authored
Dec 29, 2021
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
fix getroundinfo timeout
parent
1c87a05d
No related branches found
No related tags found
2 merge requests
!117
Release
,
!106
fix getroundinfo timeout
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/results.go
+7
-16
7 additions, 16 deletions
api/results.go
with
7 additions
and
16 deletions
api/results.go
+
7
−
16
View file @
076d88f1
...
...
@@ -98,8 +98,12 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
// Every round is timed out by default, until proven to have finished
roundsResults
[
rnd
]
=
TimeOut
roundInfo
,
err
:=
networkInstance
.
GetRound
(
rnd
)
// If we have the round in the buffer
if
err
==
nil
{
if
err
!=
nil
&&
rnd
<
oldestRound
{
// If round is older that oldest round in our buffer
// Add it to the historical round request (performed later)
historicalRequest
.
Rounds
=
append
(
historicalRequest
.
Rounds
,
uint64
(
rnd
))
numResults
++
}
else
{
// Check if the round is done (completed or failed) or in progress
if
states
.
Round
(
roundInfo
.
State
)
==
states
.
COMPLETED
{
roundsResults
[
rnd
]
=
Succeeded
...
...
@@ -109,20 +113,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
}
else
{
// If in progress, add a channel monitoring its state
roundEvents
.
AddRoundEventChan
(
rnd
,
sendResults
,
timeout
-
time
.
Millisecond
,
states
.
COMPLETED
,
states
.
FAILED
)
numResults
++
}
}
else
{
// Update the oldest round (buffer may have updated externally)
if
rnd
<
oldestRound
{
// If round is older that oldest round in our buffer
// Add it to the historical round request (performed later)
historicalRequest
.
Rounds
=
append
(
historicalRequest
.
Rounds
,
uint64
(
rnd
))
numResults
++
}
else
{
// Otherwise, monitor its progress
roundEvents
.
AddRoundEventChan
(
rnd
,
sendResults
,
timeout
-
time
.
Millisecond
,
states
.
COMPLETED
,
states
.
FAILED
)
timeout
/
2
,
states
.
COMPLETED
,
states
.
FAILED
)
numResults
++
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment