mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 01:06:00 +01:00
Background job for project deletion (#36691).
Due to the deletion of dependent objects (issues etc), project deletion may take a long time. This patch moves the actual project deletion into an ActiveJob job. It also introduces a new project status (SCHEDULED_FOR_DELETION) that is used to effectively hide the project that is about to be deleted (and any potential descendant projects) from the system immediately. A security notification is sent out to the user that deleted the project, informing about success / failure. The projects list is extended to be able to filter for the new status, so in case of a failure, the project can still be accessed for examination. Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21591 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -300,7 +300,8 @@ class ProjectsController < ApplicationController
|
||||
|
||||
@project_to_destroy = @project
|
||||
if api_request? || params[:confirm] == @project_to_destroy.identifier
|
||||
@project_to_destroy.destroy
|
||||
DestroyProjectJob.schedule(@project_to_destroy)
|
||||
flash[:notice] = l(:notice_successful_delete)
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to(
|
||||
|
||||
Reference in New Issue
Block a user