diff options
author | Diego Silva <diego.silva@live.com> | 2019-05-04 12:11:06 +0300 |
---|---|---|
committer | Diego Silva <diego.silva@live.com> | 2019-05-09 18:54:20 +0300 |
commit | 091b15b7421374df4e06bfdb91bef6a0c36072cf (patch) | |
tree | 9326d025e1a1e356f28847f698fcd9751f986364 /app/workers | |
parent | 389de5e1e49f19ecdcad72992cfe8884b9fc7e60 (diff) |
Change DetectRepositoryLanguagesWorker to not receive user
Fixes #60425
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/detect_repository_languages_worker.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/workers/detect_repository_languages_worker.rb b/app/workers/detect_repository_languages_worker.rb index 64bc9776d48..838c3be78f0 100644 --- a/app/workers/detect_repository_languages_worker.rb +++ b/app/workers/detect_repository_languages_worker.rb @@ -12,13 +12,12 @@ class DetectRepositoryLanguagesWorker attr_reader :project # rubocop: disable CodeReuse/ActiveRecord - def perform(project_id, user_id) + def perform(project_id, user_id = nil) @project = Project.find_by(id: project_id) - user = User.find_by(id: user_id) - return unless project && user + return unless project try_obtain_lease do - ::Projects::DetectRepositoryLanguagesService.new(project, user).execute + ::Projects::DetectRepositoryLanguagesService.new(project).execute end end # rubocop: enable CodeReuse/ActiveRecord |