diff --git a/cmd/skywire-cli/commands/node/routes.go b/cmd/skywire-cli/commands/node/routes.go index cb4b4a304e..5dd99431f0 100644 --- a/cmd/skywire-cli/commands/node/routes.go +++ b/cmd/skywire-cli/commands/node/routes.go @@ -67,7 +67,7 @@ var rmRuleCmd = &cobra.Command{ var keepAlive time.Duration func init() { - addRuleCmd.PersistentFlags().DurationVar(&keepAlive, "keep-alive", router.RouteKeepAlive, "duration after which routing rule will expire if no activity is present") + addRuleCmd.PersistentFlags().DurationVar(&keepAlive, "keep-alive", router.DefaultRouteKeepAlive, "duration after which routing rule will expire if no activity is present") } var addRuleCmd = &cobra.Command{ diff --git a/pkg/router/router.go b/pkg/router/router.go index b2d813ae7b..7d4cf3c6b5 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -23,8 +23,8 @@ import ( ) const ( - // RouteKeepAlive is the default expiration interval for routes - RouteKeepAlive = 2 * time.Hour + // DefaultRouteKeepAlive is the default expiration interval for routes + DefaultRouteKeepAlive = 2 * time.Hour // DefaultGarbageCollectDuration is the default duration for garbage collection of routing rules. DefaultGarbageCollectDuration = time.Second * 5 @@ -298,7 +298,7 @@ func (r *Router) requestLoop(ctx context.Context, appConn *app.Protocol, raddr r Local: laddr, Remote: raddr, }, - KeepAlive: RouteKeepAlive, + KeepAlive: DefaultRouteKeepAlive, Forward: forwardRoute, Reverse: reverseRoute, } diff --git a/pkg/visor/rpc_client.go b/pkg/visor/rpc_client.go index 298be00ab1..eb1d4deff1 100644 --- a/pkg/visor/rpc_client.go +++ b/pkg/visor/rpc_client.go @@ -3,6 +3,7 @@ package visor import ( "encoding/binary" "fmt" + "github.com/skycoin/skywire/pkg/router" "math/rand" "net/rpc" "sync" @@ -199,7 +200,7 @@ func NewMockRPCClient(r *rand.Rand, maxTps int, maxRules int) (cipher.PubKey, RP log.Infof("tp[%2d]: %v", i, tps[i]) } rt := routing.InMemoryRoutingTable() - ruleKeepAlive := 24 * time.Hour + ruleKeepAlive := router.DefaultRouteKeepAlive for i := 0; i < r.Intn(maxRules+1); i++ { remotePK, _ := cipher.GenerateKeyPair() var lpRaw, rpRaw [2]byte