Class: Clusters::Cleanup::ProjectNamespaceWorker
- Inherits:
-
Object
- Object
- Clusters::Cleanup::ProjectNamespaceWorker
- Includes:
- ClusterCleanupMethods
- Defined in:
- app/workers/clusters/cleanup/project_namespace_worker.rb
Overview
rubocop:disable Scalability/IdempotentWorker
Constant Summary
Constants included from ClusterCleanupMethods
ClusterCleanupMethods::DEFAULT_EXECUTION_LIMIT, ClusterCleanupMethods::ExceededExecutionLimitError
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DATA_CONSISTENCY_PER_DB, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::LOAD_BALANCED_DATA_CONSISTENCIES, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform(cluster_id, execution_count = 0) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/workers/clusters/cleanup/project_namespace_worker.rb', line 8 def perform(cluster_id, execution_count = 0) Clusters::Cluster.find_by_id(cluster_id).try do |cluster| break unless cluster.cleanup_removing_project_namespaces? break exceeded_execution_limit(cluster) if exceeded_execution_limit?(execution_count) Clusters::Cleanup::ProjectNamespaceService.new(cluster, execution_count).execute end end |