diff --git a/kms/kmspeers.go b/kms/kmspeers.go index 720afb570b8a9c83f8fefd7c1aaabbef38c5b159..91a511c3d926548be01344e1894b088178042f78 100644 --- a/kms/kmspeers.go +++ b/kms/kmspeers.go @@ -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 {