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:
Marius Balteanu
2022-05-17 20:45:41 +00:00
parent 3719eb32f4
commit 883aa3b5cc
12 changed files with 190 additions and 9 deletions

View File

@@ -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(