2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-21 10:15:12 -04:00
|
|
|
class DeleteMergedBranchesWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2016-09-21 10:15:12 -04:00
|
|
|
|
2019-10-18 07:11:44 -04:00
|
|
|
feature_category :source_code_management
|
|
|
|
|
2016-09-21 10:15:12 -04:00
|
|
|
def perform(project_id, user_id)
|
|
|
|
begin
|
|
|
|
project = Project.find(project_id)
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
user = User.find(user_id)
|
|
|
|
|
|
|
|
begin
|
2019-12-03 13:06:49 -05:00
|
|
|
::Branches::DeleteMergedService.new(project, user).execute
|
2016-09-21 10:15:12 -04:00
|
|
|
rescue Gitlab::Access::AccessDeniedError
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|