Merge pull request #450 from bhandras/daemon-stop-fix

pull/452/head
András Bánki-Horváth 2 years ago committed by GitHub
commit 5f0c118088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -161,6 +161,7 @@ func NewClient(dbDir string, cfg *ClientConfig) (*Client, func(), error) {
cleanup := func() { cleanup := func() {
swapServerClient.stop() swapServerClient.stop()
store.Close()
} }
return client, cleanup, nil 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 // The client and the macaroon service are the only things we
// started yet, so if we clean that up now, nothing else needs // started yet, so if we clean that up now, nothing else needs
// to be shut down at this point. // 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", log.Errorf("Error shutting down macaroon service: %v",
err) err)
} }
@ -520,7 +520,7 @@ func (d *Daemon) stop() {
d.restCtxCancel() d.restCtxCancel()
} }
err := d.macaroonService.Close() err := d.StopMacaroonService()
if err != nil { if err != nil {
log.Errorf("Error stopping macaroon service: %v", err) log.Errorf("Error stopping macaroon service: %v", err)
} }

@ -224,8 +224,8 @@ func (d *Daemon) startMacaroonService(createDefaultMacaroonFile bool) error {
return nil return nil
} }
// stopMacaroonService closes the macaroon database. // StopMacaroonService closes the macaroon database.
func (d *Daemon) stopMacaroonService() error { func (d *Daemon) StopMacaroonService() error {
var shutdownErr error var shutdownErr error
if err := d.macaroonService.Close(); err != nil { if err := d.macaroonService.Close(); err != nil {
log.Errorf("Error closing macaroon service: %v", err) log.Errorf("Error closing macaroon service: %v", err)

@ -24,4 +24,6 @@ This file tracks release notes for the loop client.
#### Bug Fixes #### Bug Fixes
* Close local databases when loopd daemon is stopped programmatically.
#### Maintenance #### Maintenance

Loading…
Cancel
Save