diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-10 15:11:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-10 15:11:04 +0300 |
commit | 03d905f63fe0c0cab4711bf1ff41887b595e6e49 (patch) | |
tree | be5f939b7bf5194c0a790f5214689286e459847c /app/workers | |
parent | 7d30ce5e229cd381f8ebe208afb5523400f8c9b5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
6 files changed, 44 insertions, 35 deletions
diff --git a/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb b/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb index 6d6dea10e64..73f4ea580c4 100644 --- a/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_protected_branches_worker.rb @@ -15,9 +15,7 @@ module Gitlab # client - An instance of Gitlab::GithubImport::Client. # project - An instance of Project. def import(client, project) - info(project.id, - message: "starting importer", - importer: 'Importer::ProtectedBranchesImporter') + info(project.id, message: "starting importer", importer: 'Importer::ProtectedBranchesImporter') waiter = Importer::ProtectedBranchesImporter .new(project, client) .execute diff --git a/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb b/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb index 5e675193a8c..a216f3d4ebc 100644 --- a/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb +++ b/app/workers/gitlab/jira_import/stuck_jira_import_jobs_worker.rb @@ -8,9 +8,11 @@ module Gitlab private def track_metrics(with_jid_count, without_jid_count) - Gitlab::Metrics.add_event(:stuck_jira_import_jobs, - jira_imports_without_jid_count: with_jid_count, - jira_imports_with_jid_count: without_jid_count) + Gitlab::Metrics.add_event( + :stuck_jira_import_jobs, + jira_imports_without_jid_count: with_jid_count, + jira_imports_with_jid_count: without_jid_count + ) end def enqueued_import_states diff --git a/app/workers/repository_update_remote_mirror_worker.rb b/app/workers/repository_update_remote_mirror_worker.rb index 9265449fdf4..598cf9ce567 100644 --- a/app/workers/repository_update_remote_mirror_worker.rb +++ b/app/workers/repository_update_remote_mirror_worker.rb @@ -25,10 +25,12 @@ class RepositoryUpdateRemoteMirrorWorker # If the update is already running, wait for it to finish before running again # This will wait for a total of 90 seconds in 3 steps - in_lock(remote_mirror_update_lock(remote_mirror.id), - retries: 3, - ttl: remote_mirror.max_runtime, - sleep_sec: LOCK_WAIT_TIME) do + in_lock( + remote_mirror_update_lock(remote_mirror.id), + retries: 3, + ttl: remote_mirror.max_runtime, + sleep_sec: LOCK_WAIT_TIME + ) do update_mirror(remote_mirror, scheduled_time, tries) end rescue Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError diff --git a/app/workers/run_pipeline_schedule_worker.rb b/app/workers/run_pipeline_schedule_worker.rb index a7037863ef5..4ca366efcad 100644 --- a/app/workers/run_pipeline_schedule_worker.rb +++ b/app/workers/run_pipeline_schedule_worker.rb @@ -63,15 +63,17 @@ class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker end def track_error(schedule, error) - Gitlab::ErrorTracking - .track_and_raise_for_dev_exception(error, - issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/41231', - schedule_id: schedule.id) + Gitlab::ErrorTracking.track_and_raise_for_dev_exception( + error, + issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/41231', + schedule_id: schedule.id + ) end def failed_creation_counter - @failed_creation_counter ||= - Gitlab::Metrics.counter(:pipeline_schedule_creation_failed_total, - "Counter of failed attempts of pipeline schedule creation") + @failed_creation_counter ||= Gitlab::Metrics.counter( + :pipeline_schedule_creation_failed_total, + "Counter of failed attempts of pipeline schedule creation" + ) end end diff --git a/app/workers/stuck_export_jobs_worker.rb b/app/workers/stuck_export_jobs_worker.rb index 486d40c443a..ab06ca3107e 100644 --- a/app/workers/stuck_export_jobs_worker.rb +++ b/app/workers/stuck_export_jobs_worker.rb @@ -20,8 +20,7 @@ class StuckExportJobsWorker def perform failed_jobs_count = mark_stuck_jobs_as_failed! - Gitlab::Metrics.add_event(:stuck_export_jobs, - failed_jobs_count: failed_jobs_count) + Gitlab::Metrics.add_event(:stuck_export_jobs, failed_jobs_count: failed_jobs_count) end private diff --git a/app/workers/x509_issuer_crl_check_worker.rb b/app/workers/x509_issuer_crl_check_worker.rb index cb5bae7ca4e..58084405769 100644 --- a/app/workers/x509_issuer_crl_check_worker.rb +++ b/app/workers/x509_issuer_crl_check_worker.rb @@ -40,14 +40,16 @@ class X509IssuerCrlCheckWorker certs = issuer.x509_certificates.where(serial_number: batch, certificate_status: :good) # rubocop: disable CodeReuse/ActiveRecord certs.find_each do |cert| - logger.info(message: "Certificate revoked", - id: cert.id, - email: cert.email, - subject: cert.subject, - serial_number: cert.serial_number, - issuer: cert.x509_issuer.id, - issuer_subject: cert.x509_issuer.subject, - issuer_crl_url: cert.x509_issuer.crl_url) + logger.info( + message: "Certificate revoked", + id: cert.id, + email: cert.email, + subject: cert.subject, + serial_number: cert.serial_number, + issuer: cert.x509_issuer.id, + issuer_subject: cert.x509_issuer.subject, + issuer_crl_url: cert.x509_issuer.crl_url + ) end certs.update_all(certificate_status: :revoked) @@ -60,19 +62,23 @@ class X509IssuerCrlCheckWorker if response&.code == 200 OpenSSL::X509::CRL.new(response.body) else - logger.warn(message: "Failed to download certificate revocation list", - issuer: issuer.id, - issuer_subject: issuer.subject, - issuer_crl_url: issuer.crl_url) + logger.warn( + message: "Failed to download certificate revocation list", + issuer: issuer.id, + issuer_subject: issuer.subject, + issuer_crl_url: issuer.crl_url + ) nil end rescue OpenSSL::X509::CRLError - logger.warn(message: "Failed to parse certificate revocation list", - issuer: issuer.id, - issuer_subject: issuer.subject, - issuer_crl_url: issuer.crl_url) + logger.warn( + message: "Failed to parse certificate revocation list", + issuer: issuer.id, + issuer_subject: issuer.subject, + issuer_crl_url: issuer.crl_url + ) nil end |