From b17b136303aae9a45e9794a7655cec1e09b18c88 Mon Sep 17 00:00:00 2001 From: "naman.gupta" Date: Tue, 16 May 2023 16:23:59 +0530 Subject: [PATCH] Adding database health to healthcheck. Adding database health to healthcheck. Signed-off-by: naman.gupta Change-Id: I18901dd232f35fdf81441dc415b5b714ced9fb98 --- pkg/resthooks/resthooks.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/resthooks/resthooks.go b/pkg/resthooks/resthooks.go index 79e52fa..733726f 100644 --- a/pkg/resthooks/resthooks.go +++ b/pkg/resthooks/resthooks.go @@ -102,7 +102,11 @@ func createResthook(sdlInst iSdl, rmrSenderInst rmr.IRmrSender) *Resthook { } func (rh *Resthook) GetA1Health() bool { - //TODO : Add database healthcheck + _, err := rh.db.GetAll("A1m_ns") + if err != nil { + a1.Logger.Error("error in connecting to the database. err: %v", err) + return false + } a1.Logger.Debug("A1 is healthy") return true } -- 2.16.6