diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-14 18:10:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-14 18:10:02 +0300 |
commit | 59239af94f0482707d0195097e4b6ce994840346 (patch) | |
tree | f483f4e21240dc59ac57c955428640c657c39a7b /app/workers | |
parent | b7f103736153a739f0da400eba20a155e0db2797 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 9 | ||||
-rw-r--r-- | app/workers/service_desk/custom_email_verification_cleanup_worker.rb | 36 |
2 files changed, 45 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index c3200cdfe0d..1664add1ac9 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -822,6 +822,15 @@ :weight: 1 :idempotent: false :tags: [] +- :name: cronjob:service_desk_custom_email_verification_cleanup + :worker_name: ServiceDesk::CustomEmailVerificationCleanupWorker + :feature_category: :service_desk + :has_external_dependencies: false + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: cronjob:ssh_keys_expired_notification :worker_name: SshKeys::ExpiredNotificationWorker :feature_category: :compliance_management diff --git a/app/workers/service_desk/custom_email_verification_cleanup_worker.rb b/app/workers/service_desk/custom_email_verification_cleanup_worker.rb new file mode 100644 index 00000000000..6434b9b09bb --- /dev/null +++ b/app/workers/service_desk/custom_email_verification_cleanup_worker.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module ServiceDesk + # Marks custom email verifications as failed when + # verification has started and timeframe to ingest + # the verification email has closed. + # + # This ensures we can finish the verification process and send verification result emails + # even when we did not receive any verification email. + class CustomEmailVerificationCleanupWorker + include ApplicationWorker + include CronjobQueue + + idempotent! + + data_consistency :sticky + feature_category :service_desk + + def perform + # Limit ensures we have 50ms per verification before another job gets scheduled. + collection = CustomEmailVerification.started.overdue.limit(2_400) + + collection.find_each do |verification| + with_context(project: verification.project) do + CustomEmailVerifications::UpdateService.new( + project: verification.project, + current_user: nil, + params: { + mail: nil + } + ).execute + end + end + end + end +end |