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
88f41d14
Commit
88f41d14
authored
Mar 30, 2021
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
fix bug
parent
efcac23b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
network/gateway/hostPool.go
+3
-3
3 additions, 3 deletions
network/gateway/hostPool.go
with
3 additions
and
3 deletions
network/gateway/hostPool.go
+
3
−
3
View file @
88f41d14
...
...
@@ -270,7 +270,7 @@ func (h *HostPool) ForceAdd(gwIds []*id.ID) error {
h
.
hostMux
.
Lock
()
defer
h
.
hostMux
.
Unlock
()
checked
:=
make
(
map
[
int
]
interface
{})
// Keep track of Hosts already replaced
checked
:=
make
(
map
[
u
int
32
]
interface
{})
// Keep track of Hosts already replaced
for
i
:=
0
;
i
<
len
(
gwIds
);
{
// Verify the GwId is not already in the hostMap
if
_
,
ok
:=
h
.
hostMap
[
*
gwIds
[
i
]];
ok
{
...
...
@@ -279,12 +279,12 @@ func (h *HostPool) ForceAdd(gwIds []*id.ID) error {
// Randomly select another Gateway in the HostPool for replacement
poolIdx
:=
readRangeUint32
(
0
,
h
.
poolParams
.
poolSize
,
h
.
rng
)
if
_
,
ok
:=
checked
[
i
];
!
ok
{
if
_
,
ok
:=
checked
[
poolIdx
];
!
ok
{
err
:=
h
.
replaceHost
(
gwIds
[
i
],
poolIdx
)
if
err
!=
nil
{
return
err
}
checked
[
i
]
=
nil
checked
[
poolIdx
]
=
nil
i
++
}
}
...
...
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