Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/ci/pipeline/destroy.rb')
-rw-r--r--app/graphql/mutations/ci/pipeline/destroy.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/graphql/mutations/ci/pipeline/destroy.rb b/app/graphql/mutations/ci/pipeline/destroy.rb
index 3f933818ce1..935cf45c4ab 100644
--- a/app/graphql/mutations/ci/pipeline/destroy.rb
+++ b/app/graphql/mutations/ci/pipeline/destroy.rb
@@ -12,12 +12,25 @@ module Mutations
pipeline = authorized_find!(id: id)
project = pipeline.project
+ return undergoing_refresh_error(project) if project.refreshing_build_artifacts_size?
+
result = ::Ci::DestroyPipelineService.new(project, current_user).execute(pipeline)
{
success: result.success?,
errors: result.errors
}
end
+
+ private
+
+ def undergoing_refresh_error(project)
+ Gitlab::ProjectStatsRefreshConflictsLogger.warn_request_rejected_during_stats_refresh(project.id)
+
+ {
+ success: false,
+ errors: ['Action temporarily disabled. The project this pipeline belongs to is undergoing stats refresh.']
+ }
+ end
end
end
end