From cfc34a3adcc82cfbb0182d179d4cceac91c0a4a1 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Tue, 5 Sep 2023 15:48:40 +0100 Subject: [PATCH] vspd: Extract const time period for dcrd check. --- cmd/vspd/vspd.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/vspd/vspd.go b/cmd/vspd/vspd.go index dfde738..e638742 100644 --- a/cmd/vspd/vspd.go +++ b/cmd/vspd/vspd.go @@ -34,6 +34,9 @@ const ( // consistencyInterval is the time period between wallet consistency checks. consistencyInterval = 30 * time.Minute + + // dcrdInterval is the time period between dcrd connection checks. + dcrdInterval = time.Second * 15 ) type vspd struct { @@ -197,7 +200,7 @@ func (v *vspd) run() int { case <-shutdownCtx.Done(): shutdownWg.Done() return - case <-time.After(time.Second * 15): + case <-time.After(dcrdInterval): // Ensure dcrd client is still connected. _, _, err := v.dcrd.Client() if err != nil {