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
9ca49ea5
Commit
9ca49ea5
authored
4 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
fixed historical rounds
parent
4083743f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
network/rounds/historical.go
+6
-2
6 additions, 2 deletions
network/rounds/historical.go
with
6 additions
and
2 deletions
network/rounds/historical.go
+
6
−
2
View file @
9ca49ea5
...
...
@@ -28,7 +28,8 @@ type historicalRoundsComms interface {
// Waits to request many rounds at a time or for a timeout to trigger
func
(
m
*
Manager
)
processHistoricalRounds
(
comm
historicalRoundsComms
,
quitCh
<-
chan
struct
{})
{
timer
:=
make
(
chan
time
.
Time
)
timerCh
:=
make
(
<-
chan
time
.
Time
)
hasTimer
:=
false
rng
:=
m
.
Rng
.
GetStream
()
var
rounds
[]
uint64
...
...
@@ -42,7 +43,8 @@ func (m *Manager) processHistoricalRounds(comm historicalRoundsComms, quitCh <-c
rng
.
Close
()
done
=
true
// if the timer elapses process rounds to ensure the delay isn't too long
case
<-
ticker
.
C
:
case
<-
timerCh
:
hasTimer
=
false
if
len
(
rounds
)
>
0
{
shouldProcess
=
true
}
...
...
@@ -51,6 +53,8 @@ func (m *Manager) processHistoricalRounds(comm historicalRoundsComms, quitCh <-c
rounds
=
append
(
rounds
,
uint64
(
rid
))
if
len
(
rounds
)
>
int
(
m
.
params
.
MaxHistoricalRounds
)
{
shouldProcess
=
true
}
else
if
!
hasTimer
{
timerCh
=
time
.
NewTimer
(
m
.
params
.
HistoricalRoundsPeriod
)
.
C
}
}
if
!
shouldProcess
{
...
...
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