Class: IrkerWorker
- Inherits:
-
Object
- Object
- IrkerWorker
- Includes:
- ApplicationWorker
- Defined in:
- app/workers/irker_worker.rb
Overview
rubocop:disable Scalability/IdempotentWorker
Constant Summary
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform(project_id, channels, colors, push_data, settings) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/workers/irker_worker.rb', line 15 def perform(project_id, channels, colors, push_data, settings) # Establish connection to irker server return false unless start_connection(settings['server_host'], settings['server_port']) @project = Project.find(project_id) @colors = colors @channels = channels @repo_path = @project.full_path @repo_name = push_data['repository']['name'] @committer = push_data['user_name'] @branch = push_data['ref'].gsub(%r'refs/[^/]*/', '') if @colors @repo_name = "\x0304#{@repo_name}\x0f" @branch = "\x0305#{@branch}\x0f" end # First messages are for branch creation/deletion send_branch_updates(push_data) # Next messages are for commits send_commits(push_data) close_connection true end |