pruner: use envconst to configure retry interval

This commit is contained in:
Christian Schwarz 2018-10-19 15:58:51 +02:00
parent e63ac7d1bb
commit f535b2327f

View File

@ -9,6 +9,7 @@ import (
"github.com/zrepl/zrepl/logger" "github.com/zrepl/zrepl/logger"
"github.com/zrepl/zrepl/pruning" "github.com/zrepl/zrepl/pruning"
"github.com/zrepl/zrepl/replication/pdu" "github.com/zrepl/zrepl/replication/pdu"
"github.com/zrepl/zrepl/util/envconst"
"github.com/zrepl/zrepl/util/watchdog" "github.com/zrepl/zrepl/util/watchdog"
"net" "net"
"sort" "sort"
@ -113,11 +114,11 @@ func NewPrunerFactory(in config.PruningSenderReceiver, promPruneSecs *prometheus
considerSnapAtCursorReplicated = considerSnapAtCursorReplicated || !knr.KeepSnapshotAtCursor considerSnapAtCursorReplicated = considerSnapAtCursorReplicated || !knr.KeepSnapshotAtCursor
} }
f := &PrunerFactory{ f := &PrunerFactory{
keepRulesSender, senderRules: keepRulesSender,
keepRulesReceiver, receiverRules: keepRulesReceiver,
10 * time.Second, //FIXME constant retryWait: envconst.Duration("ZREPL_PRUNER_RETRY_INTERVAL", 4 * time.Second),
considerSnapAtCursorReplicated, considerSnapAtCursorReplicated: considerSnapAtCursorReplicated,
promPruneSecs, promPruneSecs: promPruneSecs,
} }
return f, nil return f, nil
} }