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/shell_destroy_service.rb')
-rw-r--r--app/services/repositories/shell_destroy_service.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/services/repositories/shell_destroy_service.rb b/app/services/repositories/shell_destroy_service.rb
new file mode 100644
index 00000000000..2f5af10e24c
--- /dev/null
+++ b/app/services/repositories/shell_destroy_service.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class Repositories::ShellDestroyService < Repositories::BaseService
+ REPO_REMOVAL_DELAY = 5.minutes.to_i
+ STALE_REMOVAL_DELAY = REPO_REMOVAL_DELAY * 2
+
+ def execute(delay = REPO_REMOVAL_DELAY)
+ return success unless repository
+
+ GitlabShellWorker.perform_in(delay,
+ :remove_repository,
+ repository_storage,
+ removal_path)
+ end
+end