Class: Repositories::PostReceiveWorker
- Inherits:
-
Object
- Object
- Repositories::PostReceiveWorker
- Includes:
- ApplicationWorker, Gitlab::ExclusiveLeaseHelpers, Gitlab::Experiment::Dsl
- Defined in:
- app/workers/repositories/post_receive_worker.rb
Constant Summary
Constants included from Gitlab::ExclusiveLeaseHelpers
Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_CONCURRENCY_LIMIT_PERCENTAGE_BY_URGENCY, 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::ExclusiveLeaseHelpers
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform(gl_repository, identifier, changes, push_options = {}, params = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/workers/repositories/post_receive_worker.rb', line 21 def perform(gl_repository, identifier, changes, = {}, params = {}) gitaly_context = params['gitaly_context'] || {} container, project, repo_type = Gitlab::GlRepository.parse(gl_repository) @project = project @gl_repository = gl_repository if container.nil? || (container.is_a?(ProjectSnippet) && project.nil?) log("Triggered hook for non-existing gl_repository \"#{gl_repository}\"") return false end changes = Base64.decode64(changes) unless changes.include?(' ') # Use Sidekiq.logger so arguments can be correlated with execution # time and thread ID's. Sidekiq.logger.info "changes: #{changes.inspect}" if SidekiqLogArguments.enabled? post_received = Gitlab::GitPostReceive.new(container, identifier, changes, , gitaly_context) if repo_type.wiki? process_wiki_changes(post_received, container) elsif repo_type.project? process_project_changes(post_received, container) elsif repo_type.snippet? process_snippet_changes(post_received, container) elsif repo_type.design? process_design_management_repository_changes(post_received, container) # Other repos don't have hooks for now end end |