diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-18 13:07:53 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-01-31 22:53:56 +0000 |
commit | e9e8a2f60811c460d0bb850da2bb35ea43e35698 (patch) | |
tree | c12f1c59ef1a40b7046b2ef484a7abe2bcb09304 /app/workers | |
parent | 9ff381c492695bf9b76b27047bd0b38a70a4daac (diff) | |
download | gitlab-ce-e9e8a2f60811c460d0bb850da2bb35ea43e35698.tar.gz |
Asynchronously remove pages
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/pages_worker.rb | 11 |
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 |