diff options
author | Josh Frye <joshfng@gmail.com> | 2016-01-22 11:13:37 -0800 |
---|---|---|
committer | Josh Frye <joshfng@gmail.com> | 2016-01-29 09:14:16 -0500 |
commit | 91b9cbff8de538c2966bca94c517ee6aa346f79b (patch) | |
tree | 9bce929d696fca03c86bba32f73fdb057541b024 /app/workers | |
parent | 227728712ec5b469a36dbaf8c9511098b4817741 (diff) | |
download | gitlab-ce-91b9cbff8de538c2966bca94c517ee6aa346f79b.tar.gz |
First pass at deleting projects in the background.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/project_destroy_worker.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/workers/project_destroy_worker.rb b/app/workers/project_destroy_worker.rb new file mode 100644 index 00000000000..d06e4480292 --- /dev/null +++ b/app/workers/project_destroy_worker.rb @@ -0,0 +1,17 @@ +class ProjectDestroyWorker + include Sidekiq::Worker + + sidekiq_options queue: :default + + def perform(project_id, user_id, params) + begin + project = Project.find(project_id) + rescue ActiveRecord::RecordNotFound + return + end + + user = User.find(user_id) + + ::Projects::DestroyService.new(project, user, params).execute + end +end |