mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: close dbs when the daemon stops
This commit is contained in:
parent
fa749d4f0c
commit
b3d8f5f096
3 changed files with 5 additions and 4 deletions
|
|
@ -161,6 +161,7 @@ func NewClient(dbDir string, cfg *ClientConfig) (*Client, func(), error) {
|
|||
|
||||
cleanup := func() {
|
||||
swapServerClient.stop()
|
||||
store.Close()
|
||||
}
|
||||
|
||||
return client, cleanup, nil
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ func (d *Daemon) initialize(createDefaultMacaroonFile bool) error {
|
|||
// The client and the macaroon service are the only things we
|
||||
// started yet, so if we clean that up now, nothing else needs
|
||||
// to be shut down at this point.
|
||||
if err := d.stopMacaroonService(); err != nil {
|
||||
if err := d.StopMacaroonService(); err != nil {
|
||||
log.Errorf("Error shutting down macaroon service: %v",
|
||||
err)
|
||||
}
|
||||
|
|
@ -520,7 +520,7 @@ func (d *Daemon) stop() {
|
|||
d.restCtxCancel()
|
||||
}
|
||||
|
||||
err := d.macaroonService.Close()
|
||||
err := d.StopMacaroonService()
|
||||
if err != nil {
|
||||
log.Errorf("Error stopping macaroon service: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,8 +224,8 @@ func (d *Daemon) startMacaroonService(createDefaultMacaroonFile bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// stopMacaroonService closes the macaroon database.
|
||||
func (d *Daemon) stopMacaroonService() error {
|
||||
// StopMacaroonService closes the macaroon database.
|
||||
func (d *Daemon) StopMacaroonService() error {
|
||||
var shutdownErr error
|
||||
if err := d.macaroonService.Close(); err != nil {
|
||||
log.Errorf("Error closing macaroon service: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue