diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 16:50:15 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:33:05 -0600 |
commit | 1fe7501b49f896b74102c4b970310aa9ae34da85 (patch) | |
tree | ce271afb0fbaaa14291c1dc9009cd7815ee25463 /app/workers | |
parent | bdbc7d967a0c3d95d5e4ea19a2a5be41268d3540 (diff) | |
download | gitlab-ce-1fe7501b49f896b74102c4b970310aa9ae34da85.tar.gz |
Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/build_coverage_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/build_hooks_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/emails_on_push_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/expire_build_instance_artifacts_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/merge_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/pipeline_hooks_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/pipeline_process_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/pipeline_success_worker.rb | 6 | ||||
-rw-r--r-- | app/workers/pipeline_update_worker.rb | 4 | ||||
-rw-r--r-- | app/workers/process_commit_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/project_cache_worker.rb | 6 | ||||
-rw-r--r-- | app/workers/prune_old_events_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/repository_check/batch_worker.rb | 8 |
13 files changed, 38 insertions, 38 deletions
diff --git a/app/workers/build_coverage_worker.rb b/app/workers/build_coverage_worker.rb index def0ab1dde1..31e2dc448da 100644 --- a/app/workers/build_coverage_worker.rb +++ b/app/workers/build_coverage_worker.rb @@ -3,7 +3,7 @@ class BuildCoverageWorker include BuildQueue def perform(build_id) - Ci::Build.find_by(id: build_id) - .try(:update_coverage) + Ci::Build.find_by(id: build_id). + try(:update_coverage) end end diff --git a/app/workers/build_hooks_worker.rb b/app/workers/build_hooks_worker.rb index 9965af935d4..ff22313c491 100644 --- a/app/workers/build_hooks_worker.rb +++ b/app/workers/build_hooks_worker.rb @@ -3,7 +3,7 @@ class BuildHooksWorker include BuildQueue def perform(build_id) - Ci::Build.find_by(id: build_id) - .try(:execute_hooks) + Ci::Build.find_by(id: build_id). + try(:execute_hooks) end end diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb index f5ccc84c160..d4c3f14ec06 100644 --- a/app/workers/emails_on_push_worker.rb +++ b/app/workers/emails_on_push_worker.rb @@ -33,15 +33,15 @@ class EmailsOnPushWorker reverse_compare = false if action == :push - compare = CompareService.new(project, after_sha) - .execute(project, before_sha) + compare = CompareService.new(project, after_sha). + execute(project, before_sha) diff_refs = compare.diff_refs return false if compare.same if compare.commits.empty? - compare = CompareService.new(project, before_sha) - .execute(project, after_sha) + compare = CompareService.new(project, before_sha). + execute(project, after_sha) diff_refs = compare.diff_refs reverse_compare = true diff --git a/app/workers/expire_build_instance_artifacts_worker.rb b/app/workers/expire_build_instance_artifacts_worker.rb index eb403c134d1..2c29a9a58e1 100644 --- a/app/workers/expire_build_instance_artifacts_worker.rb +++ b/app/workers/expire_build_instance_artifacts_worker.rb @@ -3,10 +3,10 @@ class ExpireBuildInstanceArtifactsWorker include DedicatedSidekiqQueue def perform(build_id) - build = Ci::Build - .with_expired_artifacts - .reorder(nil) - .find_by(id: build_id) + build = Ci::Build. + with_expired_artifacts. + reorder(nil). + find_by(id: build_id) return unless build.try(:project) diff --git a/app/workers/merge_worker.rb b/app/workers/merge_worker.rb index 48e2da338f6..79efca4f2f9 100644 --- a/app/workers/merge_worker.rb +++ b/app/workers/merge_worker.rb @@ -7,7 +7,7 @@ class MergeWorker current_user = User.find(current_user_id) merge_request = MergeRequest.find(merge_request_id) - MergeRequests::MergeService.new(merge_request.target_project, current_user, params) - .execute(merge_request) + MergeRequests::MergeService.new(merge_request.target_project, current_user, params). + execute(merge_request) end end diff --git a/app/workers/pipeline_hooks_worker.rb b/app/workers/pipeline_hooks_worker.rb index 7e36eacebf8..7480a055e6a 100644 --- a/app/workers/pipeline_hooks_worker.rb +++ b/app/workers/pipeline_hooks_worker.rb @@ -3,7 +3,7 @@ class PipelineHooksWorker include PipelineQueue def perform(pipeline_id) - Ci::Pipeline.find_by(id: pipeline_id) - .try(:execute_hooks) + Ci::Pipeline.find_by(id: pipeline_id). + try(:execute_hooks) end end diff --git a/app/workers/pipeline_process_worker.rb b/app/workers/pipeline_process_worker.rb index 357e4a9a1c3..5dcb09f553e 100644 --- a/app/workers/pipeline_process_worker.rb +++ b/app/workers/pipeline_process_worker.rb @@ -3,7 +3,7 @@ class PipelineProcessWorker include PipelineQueue def perform(pipeline_id) - Ci::Pipeline.find_by(id: pipeline_id) - .try(:process!) + Ci::Pipeline.find_by(id: pipeline_id). + try(:process!) end end diff --git a/app/workers/pipeline_success_worker.rb b/app/workers/pipeline_success_worker.rb index cc0eb708cf9..ef710f374ca 100644 --- a/app/workers/pipeline_success_worker.rb +++ b/app/workers/pipeline_success_worker.rb @@ -4,9 +4,9 @@ class PipelineSuccessWorker def perform(pipeline_id) Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline| - MergeRequests::MergeWhenPipelineSucceedsService - .new(pipeline.project, nil) - .trigger(pipeline) + MergeRequests::MergeWhenPipelineSucceedsService. + new(pipeline.project, nil). + trigger(pipeline) end end end diff --git a/app/workers/pipeline_update_worker.rb b/app/workers/pipeline_update_worker.rb index 96c4152c674..e6d06d0577d 100644 --- a/app/workers/pipeline_update_worker.rb +++ b/app/workers/pipeline_update_worker.rb @@ -3,7 +3,7 @@ class PipelineUpdateWorker include PipelineQueue def perform(pipeline_id) - Ci::Pipeline.find_by(id: pipeline_id) - .try(:update_status) + Ci::Pipeline.find_by(id: pipeline_id). + try(:update_status) end end diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb index 5d7561732f1..e9a5bd7f24e 100644 --- a/app/workers/process_commit_worker.rb +++ b/app/workers/process_commit_worker.rb @@ -45,16 +45,16 @@ class ProcessCommitWorker # therefor we use IssueCollection here and skip the authorization check in # Issues::CloseService#execute. IssueCollection.new(issues).updatable_by_user(user).each do |issue| - Issues::CloseService.new(project, author) - .close_issue(issue, commit: commit) + Issues::CloseService.new(project, author). + close_issue(issue, commit: commit) end end def update_issue_metrics(commit, author) mentioned_issues = commit.all_references(author).issues - Issue::Metrics.where(issue_id: mentioned_issues.map(&:id), first_mentioned_in_commit_at: nil) - .update_all(first_mentioned_in_commit_at: commit.committed_date) + Issue::Metrics.where(issue_id: mentioned_issues.map(&:id), first_mentioned_in_commit_at: nil). + update_all(first_mentioned_in_commit_at: commit.committed_date) end def build_commit(project, hash) diff --git a/app/workers/project_cache_worker.rb b/app/workers/project_cache_worker.rb index 505ff9e086e..8ff9d07860f 100644 --- a/app/workers/project_cache_worker.rb +++ b/app/workers/project_cache_worker.rb @@ -32,8 +32,8 @@ class ProjectCacheWorker private def try_obtain_lease_for(project_id, section) - Gitlab::ExclusiveLease - .new("project_cache_worker:#{project_id}:#{section}", timeout: LEASE_TIMEOUT) - .try_obtain + Gitlab::ExclusiveLease. + new("project_cache_worker:#{project_id}:#{section}", timeout: LEASE_TIMEOUT). + try_obtain end end diff --git a/app/workers/prune_old_events_worker.rb b/app/workers/prune_old_events_worker.rb index cee05b42dd7..392abb9c21b 100644 --- a/app/workers/prune_old_events_worker.rb +++ b/app/workers/prune_old_events_worker.rb @@ -10,9 +10,9 @@ class PruneOldEventsWorker '(id IN (SELECT id FROM (?) ids_to_remove))', Event.unscoped.where( 'created_at < ?', - (12.months + 1.day).ago) - .select(:id) - .limit(10_000) - ).delete_all + (12.months + 1.day).ago). + select(:id). + limit(10_000)). + delete_all end end diff --git a/app/workers/repository_check/batch_worker.rb b/app/workers/repository_check/batch_worker.rb index b94d83bd709..c3e7491ec4e 100644 --- a/app/workers/repository_check/batch_worker.rb +++ b/app/workers/repository_check/batch_worker.rb @@ -32,10 +32,10 @@ module RepositoryCheck # has to sit and wait for this query to finish. def project_ids limit = 10_000 - never_checked_projects = Project.where('last_repository_check_at IS NULL AND created_at < ?', 24.hours.ago) - .limit(limit).pluck(:id) - old_check_projects = Project.where('last_repository_check_at < ?', 1.month.ago) - .reorder('last_repository_check_at ASC').limit(limit).pluck(:id) + never_checked_projects = Project.where('last_repository_check_at IS NULL AND created_at < ?', 24.hours.ago). + limit(limit).pluck(:id) + old_check_projects = Project.where('last_repository_check_at < ?', 1.month.ago). + reorder('last_repository_check_at ASC').limit(limit).pluck(:id) never_checked_projects + old_check_projects end |