-
Notifications
You must be signed in to change notification settings - Fork 103
[sql-25] firewalldb: start cleaning up RulesDB/KVStores code #1023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5026e66
69a2512
261c547
5440c19
8bc7dd3
5dd0479
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import ( | |
"path/filepath" | ||
|
||
"github.com/lightninglabs/lightning-terminal/accounts" | ||
"github.com/lightninglabs/lightning-terminal/firewalldb" | ||
"github.com/lightninglabs/lightning-terminal/session" | ||
"github.com/lightningnetwork/lnd/clock" | ||
) | ||
|
@@ -46,18 +47,37 @@ func NewStores(cfg *Config, clock clock.Clock) (*stores, error) { | |
err) | ||
} | ||
|
||
firewallDB, err := firewalldb.NewBoltDB( | ||
networkDir, firewalldb.DBFilename, sessStore, | ||
) | ||
if err != nil { | ||
return nil, fmt.Errorf("error creating firewall DB: %v", err) | ||
} | ||
Comment on lines
+50
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmmm this is pre-existing, so I'll let you decide if you'd want to address this or not: Not sure if that's something we'd want to address or not, so will let you decide on that :)! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great catch! yes this absolutely should be addressed. But I will do it in a follow up since these commits have already been approved and since the issue was introduced before (my bad!). |
||
|
||
return &stores{ | ||
accounts: acctStore, | ||
sessions: sessStore, | ||
accounts: acctStore, | ||
sessions: sessStore, | ||
firewallBolt: firewallDB, | ||
firewall: firewalldb.NewDB(firewallDB), | ||
close: func() error { | ||
ViktorTigerstrom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var returnErr error | ||
if err := acctStore.Close(); err != nil { | ||
returnErr = fmt.Errorf("error closing "+ | ||
"account store: %v", err) | ||
|
||
log.Error(returnErr.Error()) | ||
} | ||
if err := sessStore.Close(); err != nil { | ||
returnErr = fmt.Errorf("error closing "+ | ||
"session store: %v", err) | ||
|
||
log.Error(returnErr.Error()) | ||
} | ||
if err := firewallDB.Close(); err != nil { | ||
returnErr = fmt.Errorf("error closing "+ | ||
"firewall DB: %v", err) | ||
|
||
log.Error(returnErr.Error()) | ||
} | ||
|
||
return returnErr | ||
|
Uh oh!
There was an error while loading. Please reload this page.