summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-12-18 13:07:53 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-01-31 22:53:56 +0000
commite9e8a2f60811c460d0bb850da2bb35ea43e35698 (patch)
treec12f1c59ef1a40b7046b2ef484a7abe2bcb09304 /app/workers
parent9ff381c492695bf9b76b27047bd0b38a70a4daac (diff)
downloadgitlab-ce-e9e8a2f60811c460d0bb850da2bb35ea43e35698.tar.gz
Asynchronously remove pages
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/pages_worker.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/workers/pages_worker.rb b/app/workers/pages_worker.rb
index 836e8d8ad9d..ff765a6c13c 100644
--- a/app/workers/pages_worker.rb
+++ b/app/workers/pages_worker.rb
@@ -7,7 +7,11 @@ class PagesWorker
sidekiq_options queue: :pages, retry: false
- def perform(build_id)
+ def perform(action, *arg)
+ send(action, *arg)
+ end
+
+ def deploy(build_id)
@build_id = build_id
return unless valid?
@@ -36,6 +40,11 @@ class PagesWorker
return false
end
+ def remove(namespace_path, project_path)
+ full_path = File.join(Settings.pages.path, namespace_path, project_path)
+ FileUtils.rm_r(full_path, force: true)
+ end
+
private
def create_status