chore: remove `--persist-messages` flag

This commit is contained in:
Richard Ramos 2022-09-12 15:58:15 -04:00 committed by RichΛrd
parent 57a525f71e
commit b242389e05
3 changed files with 7 additions and 17 deletions

View File

@ -135,12 +135,6 @@ func main() {
Usage: "Use SQLiteDB to persist information",
Destination: &options.UseDB,
},
&cli.BoolFlag{
Name: "persist-messages",
Usage: "Enable message persistence",
Destination: &options.Store.PersistMessages,
Value: false,
},
&cli.BoolFlag{
Name: "persist-peers",
Usage: "Enable peer persistence",
@ -219,7 +213,7 @@ func main() {
},
&cli.BoolFlag{
Name: "store",
Usage: "Enable relay protocol",
Usage: "Enable store protocol to persist messages",
Destination: &options.Store.Enable,
},
&cli.BoolFlag{

View File

@ -205,15 +205,12 @@ func Execute(options Options) {
nodeOpts = append(nodeOpts, node.WithWakuFilter(!options.Filter.DisableFullNode, filter.WithTimeout(options.Filter.Timeout)))
}
if options.Store.Enable {
if options.Store.PersistMessages {
nodeOpts = append(nodeOpts, node.WithWakuStore(true, options.Store.ShouldResume))
dbStore, err := persistence.NewDBStore(logger, persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, options.Store.RetentionTime))
failOnErr(err, "DBStore")
nodeOpts = append(nodeOpts, node.WithMessageProvider(dbStore))
} else {
nodeOpts = append(nodeOpts, node.WithWakuStore(false, false))
}
nodeOpts = append(nodeOpts, node.WithWakuStore(options.Store.Enable, options.Store.ShouldResume))
if options.Store.Enable && options.UseDB {
dbStore, err := persistence.NewDBStore(logger, persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, options.Store.RetentionTime))
failOnErr(err, "DBStore")
nodeOpts = append(nodeOpts, node.WithMessageProvider(dbStore))
}
if options.LightPush.Enable {

View File

@ -83,7 +83,6 @@ type LightpushOptions struct {
// node and provide message history to nodes that ask for it.
type StoreOptions struct {
Enable bool
PersistMessages bool
ShouldResume bool
RetentionTime time.Duration
RetentionMaxMessages int