Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
1e55d36b
Commit
1e55d36b
authored
Feb 23, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aa963178
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
go/neo/mastered.go
go/neo/mastered.go
+5
-5
No files found.
go/neo/mastered.go
View file @
1e55d36b
...
...
@@ -354,19 +354,19 @@ func (node *_MasteredNode) WithState(f func(cs *xneo.ClusterState) error) {
// The cluster state is guaranteed not to change during f run.
func
(
node
*
_MasteredNode
)
WithOperationalState
(
ctx
context
.
Context
,
f
func
(
mlink
*
neonet
.
NodeLink
,
s
*
xneo
.
State
)
error
)
error
{
for
{
done
:=
false
var
err
error
var
waitReady
chan
struct
{}
node
.
WithState
(
func
(
s
*
xneo
.
State
)
{
if
!
s
.
operational
{
r
eady
=
node
.
opReady
waitR
eady
=
node
.
opReady
return
}
//fmt.Printf("withOperation -> ready\n");
done
=
true
err
=
f
(
/*XXX -> s.mlink ?*/
node
.
mlink
,
s
)
})
if
done
{
if
waitReady
==
nil
{
return
err
}
...
...
@@ -386,7 +386,7 @@ func (node *_MasteredNode) WithOperationalState(ctx context.Context, f func(mlin
case
<-
ctx
.
Done
()
:
return
fmt
.
Errorf
(
"wait operational: %w"
,
ctx
.
Err
())
case
<-
r
eady
:
case
<-
waitR
eady
:
// ok - try to relock and read again.
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment