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
|
|
|
|
|
|
|
def perform(project_id, user_id)
|
|
|
|
begin
|
|
|
|
project = Project.find(project_id)
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
user = User.find(user_id)
|
|
|
|
|
|
|
|
begin
|
|
|
|
DeleteMergedBranchesService.new(project, user).execute
|
|
|
|
rescue Gitlab::Access::AccessDeniedError
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|