fix: remove useless parameter

This commit is contained in:
Richard Ramos 2021-11-05 10:38:35 -04:00
parent 6db2f258d8
commit 12a1daae74
2 changed files with 5 additions and 3 deletions

View File

@ -145,7 +145,7 @@ func Execute(options Options) {
if options.Store.Enable {
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 {
dbStore, err := persistence.NewDBStore(persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, maxDays))
failOnErr(err, "DBStore")

View File

@ -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 {
params.enableStore = true
params.storeMsgs = shouldStoreMessages
params.storeMsgs = true
params.shouldResume = shouldResume
params.maxDays = maxDays
params.maxMessages = maxMessages