Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a5c3f1c8
Commit
a5c3f1c8
authored
Nov 30, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs
parent
0b15570e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
doc/development/sidekiq_style_guide.md
doc/development/sidekiq_style_guide.md
+14
-16
No files found.
doc/development/sidekiq_style_guide.md
View file @
a5c3f1c8
...
@@ -3,6 +3,12 @@
...
@@ -3,6 +3,12 @@
This document outlines various guidelines that should be followed when adding or
This document outlines various guidelines that should be followed when adding or
modifying Sidekiq workers.
modifying Sidekiq workers.
## ApplicationWorker
All workers should include
`ApplicationWorker`
instead of
`Sidekiq::Worker`
,
which adds some convenience methods and automatically sets the queue based on
the worker's name.
## Default Queue
## Default Queue
Use of the "default" queue is not allowed. Every worker should use a queue that
Use of the "default" queue is not allowed. Every worker should use a queue that
...
@@ -13,18 +19,10 @@ A list of all available queues can be found in `config/sidekiq_queues.yml`.
...
@@ -13,18 +19,10 @@ A list of all available queues can be found in `config/sidekiq_queues.yml`.
## Dedicated Queues
## Dedicated Queues
Most workers should use their own queue. To ease this process a worker can
Most workers should use their own queue, which is automatically set based on the
include the
`DedicatedSidekiqQueue`
concern as follows:
worker class name. For a worker named
`ProcessSomethingWorker`
, the queue name
would be
`process_something`
. If you're not sure what a worker's queue name is,
```
ruby
you can find it using
`SomeWorker.queue`
.
class
ProcessSomethingWorker
include
ApplicationWorker
end
```
This will set the queue name based on the class' name, minus the
`Worker`
suffix. In the above example this would lead to the queue being
`process_something`
.
In some cases multiple workers do use the same queue. For example, the various
In some cases multiple workers do use the same queue. For example, the various
workers for updating CI pipelines all use the
`pipeline`
queue. Adding workers
workers for updating CI pipelines all use the
`pipeline`
queue. Adding workers
...
@@ -38,7 +36,7 @@ tests should be placed in `spec/workers`.
...
@@ -38,7 +36,7 @@ tests should be placed in `spec/workers`.
## Removing or renaming queues
## Removing or renaming queues
Try to avoid renaming or removing queues in minor and patch releases.
Try to avoid renaming or removing queues in minor and patch releases.
During online update instance can have pending jobs and removing the queue can
During online update instance can have pending jobs and removing the queue can
lead to those jobs being stuck forever. If you can't write migration for those
lead to those jobs being stuck forever. If you can't write migration for those
Sidekiq jobs, please consider doing rename or remove queue in major release only.
Sidekiq jobs, please consider doing rename or remove queue in major release only.
\ No newline at end of file
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