Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
cb4e4658
Commit
cb4e4658
authored
1 year ago
by
ko_oler
Browse files
Options
Downloads
Patches
Plain Diff
добавлен метод CheckState
parent
4b285cb7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/spaces/service.go
+11
-0
11 additions, 0 deletions
pkg/spaces/service.go
with
11 additions
and
0 deletions
pkg/spaces/service.go
+
11
−
0
View file @
cb4e4658
...
@@ -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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment