From 0d11c9a3f61a457da14469871f97ba26d9ba05b0 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Tue, 3 Oct 2023 15:19:37 +0530 Subject: [PATCH] feat: introduce timeout in cluster status check --- lnd/lnd_cluster.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lnd/lnd_cluster.go b/lnd/lnd_cluster.go index 5e2c09c1..f58a6688 100644 --- a/lnd/lnd_cluster.go +++ b/lnd/lnd_cluster.go @@ -27,8 +27,10 @@ func (cluster *LNDCluster) StartLivenessLoop(ctx context.Context) { case <-ctx.Done(): return case <-ticker.C: - cluster.Logger.Info("Checking cluster status") - cluster.checkClusterStatus(ctx) + cluster.Logger.Info("Checking cluster status") + checkCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + cluster.checkClusterStatus(checkCtx) } } }