Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Proto Kms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
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
danet
Proto Kms
Commits
91d29203
Commit
91d29203
authored
1 year ago
by
Martin Stiemerling
Browse files
Options
Downloads
Patches
Plain Diff
PeerHandler now checks regularily for peer.
parent
f200a63b
No related branches found
No related tags found
1 merge request
!9
First working draft version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kms/kmspeers.go
+14
-0
14 additions, 0 deletions
kms/kmspeers.go
with
14 additions
and
0 deletions
kms/kmspeers.go
+
14
−
0
View file @
91d29203
...
...
@@ -74,6 +74,20 @@ func (ph *kmsPeer) PeerHandler(kmsName string) {
log
.
Printf
(
"Greeting: %s which is now in peerStatus %d"
,
r
.
GetPeerKmsName
(),
ph
.
peerStatus
)
// By now, do check only the liveliness of the peer, nothing else.
for
{
time
.
Sleep
(
30
*
time
.
Second
)
// Contact the server and print out its response.
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Second
)
defer
cancel
()
r
,
err
:=
c
.
ETSICapabilities
(
ctx
,
&
pb
.
ETSICapabilitiesRequest
{
MyKmsName
:
kmsName
})
if
err
!=
nil
{
log
.
Printf
(
"could not greet: %v"
,
err
)
ph
.
peerStatus
=
kmsPeerDown
}
}
}
func
(
ph
*
kmsPeer
)
GetKmsPeerStatus
()
KmsPeerStatus
{
...
...
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