Skip to content

Commit 5880dfe

Browse files
authored
Merge pull request #436 from getAlby/task-timeout
feat: introduce timeout in cluster status check
2 parents d2d9b03 + 0d11c9a commit 5880dfe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lnd/lnd_cluster.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ func (cluster *LNDCluster) StartLivenessLoop(ctx context.Context) {
2727
case <-ctx.Done():
2828
return
2929
case <-ticker.C:
30-
cluster.Logger.Info("Checking cluster status")
31-
cluster.checkClusterStatus(ctx)
30+
cluster.Logger.Info("Checking cluster status")
31+
checkCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
32+
defer cancel()
33+
cluster.checkClusterStatus(checkCtx)
3234
}
3335
}
3436
}

0 commit comments

Comments
 (0)