multi: move failed attempt cfg option to the router subsytem
Previously we had db and application logic mixed on the db level. We now move the config option KeepFailedPaymentAttempts to the ChannelRouter level and move it out of the db level.
This commit is contained in:
10 files changed
+224
-175
No files matched your search
+1
-13
@@ -4,17 +4,12 @@ package paymentsdb
|
||||
type StoreOptions struct {
|
||||
// NoMigration allows to open the database in readonly mode
|
||||
NoMigration bool
|
||||
|
||||
// KeepFailedPaymentAttempts is a flag that determines whether to keep
|
||||
// failed payment attempts for a settled payment in the db.
|
||||
KeepFailedPaymentAttempts bool
|
||||
}
|
||||
|
||||
// DefaultOptions returns a StoreOptions populated with default values.
|
||||
func DefaultOptions() *StoreOptions {
|
||||
return &StoreOptions{
|
||||
KeepFailedPaymentAttempts: false,
|
||||
NoMigration: false,
|
||||
NoMigration: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +17,6 @@ func DefaultOptions() *StoreOptions {
|
||||
// StoreOptions.
|
||||
type OptionModifier func(*StoreOptions)
|
||||
|
||||
// WithKeepFailedPaymentAttempts sets the KeepFailedPaymentAttempts to n.
|
||||
func WithKeepFailedPaymentAttempts(n bool) OptionModifier {
|
||||
return func(o *StoreOptions) {
|
||||
o.KeepFailedPaymentAttempts = n
|
||||
}
|
||||
}
|
||||
|
||||
// WithNoMigration allows the database to be opened in read only mode by
|
||||
// disabling migrations.
|
||||
func WithNoMigration(b bool) OptionModifier {
|
||||
|
||||
Reference in new issue
Block a user