From a92784b8241061c36489dca559578fd062647efd Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Wed, 26 Jul 2023 19:21:58 +0200 Subject: [PATCH] add missing account close, for retraining junk filter for an account with the retrain cli command --- ctl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ctl.go b/ctl.go index dea229a..16bfa69 100644 --- a/ctl.go +++ b/ctl.go @@ -619,6 +619,12 @@ func servectlcmd(ctx context.Context, ctl *ctl, shutdown func()) { account := ctl.xread() acc, err := store.OpenAccount(account) ctl.xcheck(err, "open account") + defer func() { + if acc != nil { + err := acc.Close() + log.Check(err, "closing account after retraining") + } + }() acc.WithWLock(func() { conf, _ := acc.Conf()