Skip to content

Commit 5f0c118

Browse files
authored
Merge pull request #450 from bhandras/daemon-stop-fix
2 parents fa749d4 + c8a6508 commit 5f0c118

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func NewClient(dbDir string, cfg *ClientConfig) (*Client, func(), error) {
161161

162162
cleanup := func() {
163163
swapServerClient.stop()
164+
store.Close()
164165
}
165166

166167
return client, cleanup, nil

loopd/daemon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (d *Daemon) initialize(createDefaultMacaroonFile bool) error {
399399
// The client and the macaroon service are the only things we
400400
// started yet, so if we clean that up now, nothing else needs
401401
// to be shut down at this point.
402-
if err := d.stopMacaroonService(); err != nil {
402+
if err := d.StopMacaroonService(); err != nil {
403403
log.Errorf("Error shutting down macaroon service: %v",
404404
err)
405405
}
@@ -520,7 +520,7 @@ func (d *Daemon) stop() {
520520
d.restCtxCancel()
521521
}
522522

523-
err := d.macaroonService.Close()
523+
err := d.StopMacaroonService()
524524
if err != nil {
525525
log.Errorf("Error stopping macaroon service: %v", err)
526526
}

loopd/macaroons.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ func (d *Daemon) startMacaroonService(createDefaultMacaroonFile bool) error {
224224
return nil
225225
}
226226

227-
// stopMacaroonService closes the macaroon database.
228-
func (d *Daemon) stopMacaroonService() error {
227+
// StopMacaroonService closes the macaroon database.
228+
func (d *Daemon) StopMacaroonService() error {
229229
var shutdownErr error
230230
if err := d.macaroonService.Close(); err != nil {
231231
log.Errorf("Error closing macaroon service: %v", err)

release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ This file tracks release notes for the loop client.
2424

2525
#### Bug Fixes
2626

27+
* Close local databases when loopd daemon is stopped programmatically.
28+
2729
#### Maintenance

0 commit comments

Comments
 (0)