From 0d4542a3f158d76f339c2afd0aedd0fa09ba986d Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Tue, 14 Jun 2022 19:16:27 +0800 Subject: [PATCH] fix: delete account driver after get --- internal/operations/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/operations/account.go b/internal/operations/account.go index 078ee9f2..ae60183a 100644 --- a/internal/operations/account.go +++ b/internal/operations/account.go @@ -63,11 +63,11 @@ func UpdateAccount(ctx context.Context, account model.Account) error { if err != nil { return errors.WithMessage(err, "failed update account in database") } + accountDriver, err := GetAccountByVirtualPath(oldAccount.VirtualPath) if oldAccount.VirtualPath != account.VirtualPath { // virtual path renamed, need to drop the account accountsMap.Delete(oldAccount.VirtualPath) } - accountDriver, err := GetAccountByVirtualPath(oldAccount.VirtualPath) if err != nil { return errors.WithMessage(err, "failed get account driver") }