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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
7ac8dffd
Commit
7ac8dffd
authored
3 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
610ed2a9
No related branches found
No related tags found
2 merge requests
!117
Release
,
!102
first pass
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/results.go
+4
-3
4 additions, 3 deletions
api/results.go
with
4 additions
and
3 deletions
api/results.go
+
4
−
3
View file @
7ac8dffd
...
@@ -113,14 +113,14 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
...
@@ -113,14 +113,14 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
numResults
++
numResults
++
}
}
}
else
{
}
else
{
// Update oldest round (buffer may have updated externally)
// Update
the
oldest round (buffer may have updated externally)
if
rnd
<
oldestRound
{
if
rnd
<
oldestRound
{
// If round is older that oldest round in our buffer
// If round is older that oldest round in our buffer
// Add it to the historical round request (performed later)
// Add it to the historical round request (performed later)
historicalRequest
.
Rounds
=
append
(
historicalRequest
.
Rounds
,
uint64
(
rnd
))
historicalRequest
.
Rounds
=
append
(
historicalRequest
.
Rounds
,
uint64
(
rnd
))
numResults
++
numResults
++
}
else
{
}
else
{
// Otherwise, monitor it
'
s progress
// Otherwise, monitor its progress
roundEvents
.
AddRoundEventChan
(
rnd
,
sendResults
,
roundEvents
.
AddRoundEventChan
(
rnd
,
sendResults
,
timeout
-
time
.
Millisecond
,
states
.
COMPLETED
,
states
.
FAILED
)
timeout
-
time
.
Millisecond
,
states
.
COMPLETED
,
states
.
FAILED
)
numResults
++
numResults
++
...
@@ -162,6 +162,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
...
@@ -162,6 +162,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
Rounds
:
[]
uint64
{
roundReport
.
RoundInfo
.
ID
},
Rounds
:
[]
uint64
{
roundReport
.
RoundInfo
.
ID
},
}
}
// Request that round's information, feeding back into sendResults
// Request that round's information, feeding back into sendResults
jww
.
DEBUG
.
Printf
(
"Sending HistoricalRounds retry for Round %d"
,
roundReport
.
RoundInfo
.
ID
)
go
c
.
getHistoricalRounds
(
timeoutRequest
,
sendResults
,
commsInterface
)
go
c
.
getHistoricalRounds
(
timeoutRequest
,
sendResults
,
commsInterface
)
}
else
{
}
else
{
// If available, denote the result
// If available, denote the result
...
@@ -182,7 +183,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
...
@@ -182,7 +183,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
}
}
// Helper function which asynchronously pings a random gateway until
// Helper function which asynchronously pings a random gateway until
// it gets information on it
'
s requested historical rounds
// it gets information on its requested historical rounds
func
(
c
*
Client
)
getHistoricalRounds
(
msg
*
pb
.
HistoricalRounds
,
func
(
c
*
Client
)
getHistoricalRounds
(
msg
*
pb
.
HistoricalRounds
,
sendResults
chan
ds
.
EventReturn
,
comms
historicalRoundsComm
)
{
sendResults
chan
ds
.
EventReturn
,
comms
historicalRoundsComm
)
{
...
...
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