mirror of https://github.com/status-im/go-waku.git
fix: remove useless parameter
This commit is contained in:
parent
6db2f258d8
commit
12a1daae74
|
@ -145,7 +145,7 @@ func Execute(options Options) {
|
||||||
|
|
||||||
if options.Store.Enable {
|
if options.Store.Enable {
|
||||||
maxDays := time.Hour * 24 * time.Duration(options.Store.RetentionMaxDays)
|
maxDays := time.Hour * 24 * time.Duration(options.Store.RetentionMaxDays)
|
||||||
nodeOpts = append(nodeOpts, node.WithWakuStoreAndLimits(true, options.Store.ShouldResume, maxDays, options.Store.RetentionMaxMessages))
|
nodeOpts = append(nodeOpts, node.WithWakuStoreAndLimits(options.Store.ShouldResume, maxDays, options.Store.RetentionMaxMessages))
|
||||||
if options.UseDB {
|
if options.UseDB {
|
||||||
dbStore, err := persistence.NewDBStore(persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, maxDays))
|
dbStore, err := persistence.NewDBStore(persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, maxDays))
|
||||||
failOnErr(err, "DBStore")
|
failOnErr(err, "DBStore")
|
||||||
|
|
|
@ -179,10 +179,12 @@ func WithWakuStore(shouldStoreMessages bool, shouldResume bool) WakuNodeOption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithWakuStoreAndLimits(shouldStoreMessages bool, shouldResume bool, maxDays time.Duration, maxMessages int) WakuNodeOption {
|
// WithWakuStoreAndLimits enables the Waku V2 Store protocol, storing them in an optional message provider
|
||||||
|
// applying an specific retention policy
|
||||||
|
func WithWakuStoreAndLimits(shouldResume bool, maxDays time.Duration, maxMessages int) WakuNodeOption {
|
||||||
return func(params *WakuNodeParameters) error {
|
return func(params *WakuNodeParameters) error {
|
||||||
params.enableStore = true
|
params.enableStore = true
|
||||||
params.storeMsgs = shouldStoreMessages
|
params.storeMsgs = true
|
||||||
params.shouldResume = shouldResume
|
params.shouldResume = shouldResume
|
||||||
params.maxDays = maxDays
|
params.maxDays = maxDays
|
||||||
params.maxMessages = maxMessages
|
params.maxMessages = maxMessages
|
||||||
|
|
Loading…
Reference in New Issue