Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8560b4d01e03
Commit
84175072
authored
Aug 21, 2017
by
Grzegorz Bizon
Browse files
Assign all pipeline workers to specific queues
parent
5667a9365a7f
Changes
13
Hide whitespace changes
Inline
Side-by-side
app/workers/expire_pipeline_cache_worker.rb
View file @
8560b4d0
...
...
@@ -2,6 +2,8 @@ class ExpirePipelineCacheWorker
include
Sidekiq
::
Worker
include
PipelineQueue
enqueue_in
group: :cache
def
perform
(
pipeline_id
)
pipeline
=
Ci
::
Pipeline
.
find_by
(
id:
pipeline_id
)
return
unless
pipeline
...
...
app/workers/pipeline_hooks_worker.rb
View file @
8560b4d0
...
...
@@ -2,6 +2,8 @@ class PipelineHooksWorker
include
Sidekiq
::
Worker
include
PipelineQueue
enqueue_in
group: :hooks
def
perform
(
pipeline_id
)
Ci
::
Pipeline
.
find_by
(
id:
pipeline_id
)
.
try
(
:execute_hooks
)
...
...
app/workers/pipeline_metrics_worker.rb
View file @
8560b4d0
...
...
@@ -2,6 +2,8 @@ class PipelineMetricsWorker
include
Sidekiq
::
Worker
include
PipelineQueue
enqueue_in
group: :metrics
def
perform
(
pipeline_id
)
Ci
::
Pipeline
.
find_by
(
id:
pipeline_id
).
try
do
|
pipeline
|
update_metrics_for_active_pipeline
(
pipeline
)
if
pipeline
.
active?
...
...
app/workers/pipeline_notification_worker.rb
View file @
8560b4d0
...
...
@@ -2,6 +2,8 @@ class PipelineNotificationWorker
include
Sidekiq
::
Worker
include
PipelineQueue
enqueue_in
group: :hooks
def
perform
(
pipeline_id
,
recipients
=
nil
)
pipeline
=
Ci
::
Pipeline
.
find_by
(
id:
pipeline_id
)
...
...
app/workers/pipeline_process_worker.rb
View file @
8560b4d0
...
...
@@ -2,6 +2,8 @@ class PipelineProcessWorker
include
Sidekiq
::
Worker
include
PipelineQueue
enqueue_in
group: :processing
def
perform
(
pipeline_id
)
Ci
::
Pipeline
.
find_by
(
id:
pipeline_id
)
.
try
(
:process!
)
...
...
app/workers/pipeline_success_worker.rb
View file @
8560b4d0
...
...
@@ -2,6 +2,8 @@ class PipelineSuccessWorker
include
Sidekiq
::
Worker
include
PipelineQueue
enqueue_in
group: :processing
def
perform
(
pipeline_id
)
Ci
::
Pipeline
.
find_by
(
id:
pipeline_id
).
try
do
|
pipeline
|
MergeRequests
::
MergeWhenPipelineSucceedsService
...
...
config/sidekiq_queues.yml
View file @
8560b4d0
...
...
@@ -28,6 +28,9 @@
- [build, 2]
- [pipeline, 2]
- [pipeline_processing, 2]
- [pipeline_cache, 2]
- [pipeline_metrics, 2]
- [pipeline_hooks, 2]
- [gitlab_shell, 2]
- [email_receiver, 2]
- [emails_on_push, 2]
...
...
spec/workers/expire_pipeline_cache_worker_spec.rb
View file @
8560b4d0
...
...
@@ -43,4 +43,6 @@
subject
.
perform
(
pipeline
.
id
)
end
end
it_behaves_like
'sidekiq worker'
end
spec/workers/pipeline_hooks_worker_spec.rb
View file @
8560b4d0
...
...
@@ -20,4 +20,6 @@
end
end
end
it_behaves_like
'sidekiq worker'
end
spec/workers/pipeline_metrics_worker_spec.rb
View file @
8560b4d0
...
...
@@ -47,4 +47,6 @@
end
end
end
it_behaves_like
'sidekiq worker'
end
spec/workers/pipeline_notification_worker_spec.rb
View file @
8560b4d0
...
...
@@ -16,4 +16,6 @@
subject
.
perform
(
Ci
::
Pipeline
.
maximum
(
:id
).
to_i
.
succ
)
end
end
it_behaves_like
'sidekiq worker'
end
spec/workers/pipeline_process_worker_spec.rb
View file @
8560b4d0
...
...
@@ -19,4 +19,6 @@
end
end
end
it_behaves_like
'sidekiq worker'
end
spec/workers/pipeline_success_worker_spec.rb
View file @
8560b4d0
...
...
@@ -21,4 +21,6 @@
end
end
end
it_behaves_like
'sidekiq worker'
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment