fix(storage): explicitly set storages' status to disabled (#3810)

This commit is contained in:
hcrgm 2023-03-11 20:45:35 +08:00 committed by GitHub
parent 6aaec19c1c
commit 666e02f0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -2,5 +2,6 @@ package op
const (
WORK = "work"
DISABLED = "disabled"
RootName = "root"
)

View File

@ -142,6 +142,7 @@ func DisableStorage(ctx context.Context, id uint) error {
}
// delete the storage in the memory
storage.Disabled = true
storage.SetStatus(DISABLED)
err = db.UpdateStorage(storage)
if err != nil {
return errors.WithMessage(err, "failed update storage in db")