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
dda1507b
Commit
dda1507b
authored
Oct 14, 2019
by
Diana Stanley
Committed by
Evan Read
Oct 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Add examples for deleting sidekiq jobs
parent
11ca79e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md
...dministration/troubleshooting/gitlab_rails_cheat_sheet.md
+17
-0
No files found.
doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md
View file @
dda1507b
...
...
@@ -892,6 +892,23 @@ queue = Sidekiq::Queue.new('repository_import')
queue
.
each
{
|
job
|
job
.
delete
if
<
condition
>
}
```
`<condition>`
probably includes references to job arguments, which depend on the type of job in question.
| queue | worker | job args |
| ----- | ------ | -------- |
| repository_import | RepositoryImportWorker | project_id |
| update_merge_requests | UpdateMergeRequestsWorker | project_id, user_id, oldrev, newrev, ref |
**Example:**
Delete all UpdateMergeRequestsWorker jobs associated with a merge request on project_id 125,
merging branch
`ref/heads/my_branch`
.
```
ruby
queue
=
Sidekiq
::
Queue
.
new
(
'update_merge_requests'
)
queue
.
each
{
|
job
|
job
.
delete
if
job
.
args
[
0
]
==
125
and
job
.
args
[
4
]
==
'ref/heads/my_branch'
}
```
**Note:**
Running jobs will not be killed. Stop sidekiq before doing this, to get all matching jobs.
### Enable debug logging of Sidekiq
```
ruby
...
...
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