diff --git a/cmd/hostd/node.go b/cmd/hostd/node.go index 50ab10d9..0158febd 100644 --- a/cmd/hostd/node.go +++ b/cmd/hostd/node.go @@ -55,6 +55,7 @@ func (n *node) Close() error { n.rhp3.Close() n.rhp2.Close() n.data.Close() + n.registry.Close() n.storage.Close() n.contracts.Close() n.w.Close() diff --git a/host/registry/registry.go b/host/registry/registry.go index 8f2bc009..261b0796 100644 --- a/host/registry/registry.go +++ b/host/registry/registry.go @@ -122,6 +122,10 @@ func NewManager(privkey types.PrivateKey, store Store, log *zap.Logger) *Manager log: log.Named("recorder"), }, } - go m.recorder.Run(m.tg.Done()) + done, _ := m.tg.Add() + go func() { + m.recorder.Run(m.tg.Done()) + done() + }() return m } diff --git a/internal/test/host.go b/internal/test/host.go index 1a91feac..c6f128ea 100644 --- a/internal/test/host.go +++ b/internal/test/host.go @@ -84,6 +84,7 @@ func (h *Host) Close() error { h.settings.Close() h.wallet.Close() h.contracts.Close() + h.registry.Close() h.storage.Close() h.store.Close() h.Node.Close()