Commit f28eb99c authored by Evan Read's avatar Evan Read

Merge branch...

Merge branch 'docs-33656-add-rails-console-commands-for-deleting-sidekiq-jobs-to-troubleshooting-page' into 'master'

Docs: Add examples for deleting sidekiq jobs

Closes #33656

See merge request gitlab-org/gitlab!18301
parents 11ca79e3 dda1507b
...@@ -892,6 +892,23 @@ queue = Sidekiq::Queue.new('repository_import') ...@@ -892,6 +892,23 @@ queue = Sidekiq::Queue.new('repository_import')
queue.each { |job| job.delete if <condition>} 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 ### Enable debug logging of Sidekiq
```ruby ```ruby
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment