Skip to content
Snippets Groups Projects
Commit cb4e4658 authored by ko_oler's avatar ko_oler
Browse files

добавлен метод CheckState

parent 4b285cb7
No related branches found
No related tags found
No related merge requests found
...@@ -63,3 +63,14 @@ func IsSpaceAvailable(ctx context.Context, spcs Spaces, spaceId string) error { ...@@ -63,3 +63,14 @@ func IsSpaceAvailable(ctx context.Context, spcs Spaces, spaceId string) error {
return nil return nil
} }
func CheckState(ctx context.Context, spcs Spaces, spaceID string) error {
sp, err := spcs.Get(ctx, spaceID)
if err != nil {
return errors.Wrap(err, "fail to get space")
}
if sp.State == StateMigration {
return errors.Errorf("space '%s' is migrating, fail to do operation", sp.ID)
}
return nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment