diff options
Diffstat (limited to 'app/workers/concerns/gitlab/github_import')
-rw-r--r-- | app/workers/concerns/gitlab/github_import/rescheduling_methods.rb | 4 | ||||
-rw-r--r-- | app/workers/concerns/gitlab/github_import/stage_methods.rb | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/app/workers/concerns/gitlab/github_import/rescheduling_methods.rb b/app/workers/concerns/gitlab/github_import/rescheduling_methods.rb index eb1af0869bd..0a43a0fc4d2 100644 --- a/app/workers/concerns/gitlab/github_import/rescheduling_methods.rb +++ b/app/workers/concerns/gitlab/github_import/rescheduling_methods.rb @@ -8,9 +8,8 @@ module Gitlab # project_id - The ID of the GitLab project to import the note into. # hash - A Hash containing the details of the GitHub object to import. # notify_key - The Redis key to notify upon completion, if any. - # rubocop: disable CodeReuse/ActiveRecord def perform(project_id, hash, notify_key = nil) - project = Project.find_by(id: project_id) + project = Project.find_by_id(project_id) return notify_waiter(notify_key) unless project @@ -25,7 +24,6 @@ module Gitlab .perform_in(client.rate_limit_resets_in, project.id, hash, notify_key) end end - # rubocop: enable CodeReuse/ActiveRecord def try_import(*args) import(*args) diff --git a/app/workers/concerns/gitlab/github_import/stage_methods.rb b/app/workers/concerns/gitlab/github_import/stage_methods.rb index d7b4578af63..225716f6bf3 100644 --- a/app/workers/concerns/gitlab/github_import/stage_methods.rb +++ b/app/workers/concerns/gitlab/github_import/stage_methods.rb @@ -33,13 +33,13 @@ module Gitlab self.class.perform_in(client.rate_limit_resets_in, project.id) end - # rubocop: disable CodeReuse/ActiveRecord def find_project(id) # If the project has been marked as failed we want to bail out # automatically. - Project.joins_import_state.where(import_state: { status: :started }).find_by(id: id) + # rubocop: disable CodeReuse/ActiveRecord + Project.joins_import_state.where(import_state: { status: :started }).find_by_id(id) + # rubocop: enable CodeReuse/ActiveRecord end - # rubocop: enable CodeReuse/ActiveRecord def abort_on_failure false |