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/services/repositories/destroy_service.rb')
-rw-r--r--app/services/repositories/destroy_service.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/services/repositories/destroy_service.rb b/app/services/repositories/destroy_service.rb
index b12d0744387..1e34dfbe398 100644
--- a/app/services/repositories/destroy_service.rb
+++ b/app/services/repositories/destroy_service.rb
@@ -14,8 +14,17 @@ class Repositories::DestroyService < Repositories::BaseService
log_info(%Q{Repository "#{disk_path}" moved to "#{removal_path}" for repository "#{full_path}"})
current_repository = repository
- container.run_after_commit do
+
+ # Because GitlabShellWorker is inside a run_after_commit callback it will
+ # never be triggered on a read-only instance.
+ #
+ # Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/223272
+ if Gitlab::Database.read_only?
Repositories::ShellDestroyService.new(current_repository).execute
+ else
+ container.run_after_commit do
+ Repositories::ShellDestroyService.new(current_repository).execute
+ end
end
log_info("Repository \"#{full_path}\" was removed")