diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 12:08:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 12:08:55 +0300 |
commit | a2344dbf1942dc3919c55b0684d2566368e03852 (patch) | |
tree | 00f92dc8b5e2e2cb732662f5e5e0ffd5f3d2eca0 /app/workers | |
parent | 213da19cda5309148952ab770e2a9e122fe32e22 (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/clusters/agents/notify_git_push_worker.rb | 23 |
2 files changed, 32 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 0efcecae299..e9965ff0027 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -138,6 +138,15 @@ :weight: 1 :idempotent: true :tags: [] +- :name: cluster_agent:clusters_agents_notify_git_push + :worker_name: Clusters::Agents::NotifyGitPushWorker + :feature_category: :deployment_management + :has_external_dependencies: false + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: container_repository:cleanup_container_repository :worker_name: CleanupContainerRepositoryWorker :feature_category: :container_registry diff --git a/app/workers/clusters/agents/notify_git_push_worker.rb b/app/workers/clusters/agents/notify_git_push_worker.rb new file mode 100644 index 00000000000..d2994bb9144 --- /dev/null +++ b/app/workers/clusters/agents/notify_git_push_worker.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Clusters + module Agents + class NotifyGitPushWorker + include ApplicationWorker + include ClusterAgentQueue + + deduplicate :until_executed, including_scheduled: true + idempotent! + + urgency :low + data_consistency :delayed + + def perform(project_id) + return unless project = ::Project.find_by_id(project_id) + return unless Feature.enabled?(:notify_kas_on_git_push, project) + + Gitlab::Kas::Client.new.send_git_push_event(project: project) + end + end + end +end |