fix: delete account driver after get

refactor/fs
Noah Hsu 2022-06-14 19:16:27 +08:00
parent 7c4d28d55a
commit 0d4542a3f1
1 changed files with 1 additions and 1 deletions

View File

@ -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")
}