Merge branch 'log-project-deletion' into 'master'
Add a log message when a project is scheduled for destruction for debugging We have a lot of projects that are in `pending_delete` state. It's not clear whether they were ever scheduled for destruction, or whether Sidekiq just dropped the job due to `MemoryKiller` or some other reason. Also this will provide a record of which user destroys a project. #20365 See merge request !5540
This commit is contained in:
commit
15654eca7f
1 changed files with 4 additions and 1 deletions
|
@ -1164,7 +1164,10 @@ class Project < ActiveRecord::Base
|
|||
|
||||
def schedule_delete!(user_id, params)
|
||||
# Queue this task for after the commit, so once we mark pending_delete it will run
|
||||
run_after_commit { ProjectDestroyWorker.perform_async(id, user_id, params) }
|
||||
run_after_commit do
|
||||
job_id = ProjectDestroyWorker.perform_async(id, user_id, params)
|
||||
Rails.logger.info("User #{user_id} scheduled destruction of project #{path_with_namespace} with job ID #{job_id}")
|
||||
end
|
||||
|
||||
update_attribute(:pending_delete, true)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue