Skip to content

Commit

Permalink
RouteKeepAlive -> DefaultRouteKeepAlive
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Aug 23, 2019
1 parent c5c10e0 commit 9b3ad84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/skywire-cli/commands/node/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
6 changes: 3 additions & 3 deletions pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/visor/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package visor
import (
"encoding/binary"
"fmt"
"github.com/skycoin/skywire/pkg/router"
"math/rand"
"net/rpc"
"sync"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9b3ad84

Please sign in to comment.