From 9e2e01487f2ce7ff4d25ccda3c3d14a3a9b7058b Mon Sep 17 00:00:00 2001 From: rkfg Date: Sun, 30 Oct 2022 12:39:27 +0300 Subject: [PATCH] Fix node cache lifetime parameter not applying --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d35049f..dc6fe1e 100644 --- a/main.go +++ b/main.go @@ -50,7 +50,7 @@ type configParams struct { AllowUnbalanceTo bool `long:"allow-unbalance-to" description:"let the target channel go above 50% local liquidity, use if you want to refill a channel; you should also set --pto to >50" json:"allow_unbalance_to" toml:"allow_unbalance_to"` StatFilename string `short:"s" long:"stat" description:"save successful rebalance information to the specified CSV file" json:"stat" toml:"stat"` NodeCacheFilename string `long:"node-cache-filename" description:"save and load other nodes information to this file, improves cold start performance" json:"node_cache_filename" toml:"node_cache_filename"` - NodeCacheLifetime int `long:"node-cache-lifetime" description:"nodes with last update older than this time (in minutes) will be removed from cache after loading it" json:"node_cache_lifetime" toml:"node_cache_lifetime" default:"1440"` + NodeCacheLifetime int `long:"node-cache-lifetime" description:"nodes with last update older than this time (in minutes) will be removed from cache after loading it" json:"node_cache_lifetime" toml:"node_cache_lifetime"` NodeCacheInfo bool `long:"node-cache-info" description:"show red and cyan 'x' characters in routes to indicate node cache misses and hits respectively" json:"node_cache_info" toml:"node_cache_info"` } @@ -368,6 +368,9 @@ func preflightChecks(params *configParams) error { return fmt.Errorf("use either relative amounts or rapid rebalance but not both") } + if params.NodeCacheLifetime == 0 { + params.NodeCacheLifetime = 1440 + } return nil