add missing account close, for retraining junk filter for an account with the retrain cli command

This commit is contained in:
Mechiel Lukkien 2023-07-26 19:21:58 +02:00
parent e3d0a3a001
commit a92784b824
No known key found for this signature in database

6
ctl.go
View file

@ -619,6 +619,12 @@ func servectlcmd(ctx context.Context, ctl *ctl, shutdown func()) {
account := ctl.xread() account := ctl.xread()
acc, err := store.OpenAccount(account) acc, err := store.OpenAccount(account)
ctl.xcheck(err, "open account") ctl.xcheck(err, "open account")
defer func() {
if acc != nil {
err := acc.Close()
log.Check(err, "closing account after retraining")
}
}()
acc.WithWLock(func() { acc.WithWLock(func() {
conf, _ := acc.Conf() conf, _ := acc.Conf()