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/models/project.rb | |
parent | 9ff381c492695bf9b76b27047bd0b38a70a4daac (diff) | |
download | gitlab-ce-e9e8a2f60811c460d0bb850da2bb35ea43e35698.tar.gz |
Asynchronously remove pages
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index e9c7108e805..7a5bf77c5a9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1186,7 +1186,11 @@ class Project < ActiveRecord::Base end def remove_pages - FileUtils.rm_r(pages_path, force: true) + temp_path = "#{path}.#{SecureRandom.hex}" + + if Gitlab::PagesTransfer.new.rename_project(path, temp_path, namespace.path) + PagesWorker.perform_in(5.minutes, :remove, namespace.path, temp_path) + end end def wiki |