Sidekiq 队列管理 API

  • Tier: 基础版, 专业版, 旗舰版
  • Offering: 私有化部署

删除与给定 元数据 匹配的 Sidekiq 队列中的作业。

响应有三个字段:

  1. deleted_jobs - 请求删除的作业数量。
  2. queue_size - 处理请求后队列的剩余大小。
  3. completed - 请求是否能够及时处理整个队列。如果没有,使用相同参数重试可能会删除更多作业(包括在首次请求发出后添加的作业)。

此 API 端点仅对 管理员 可用。

plaintext
DELETE /admin/sidekiq/queues/:queue_name
属性类型必需描述
queue_namestring要从中删除作业的队列名称
userstring安排作业的用户的用户名
projectstring安排作业的项目的完整路径
root_namespacestring项目的根命名空间
subscription_planstring根命名空间的订阅计划(仅限 JihuLab.com)
caller_idstring安排作业的端点或后台作业(例如:ProjectsController#create, /api/:version/projects/:id, PostReceive
feature_categorystring后台作业的功能类别(例如:team_planningcode_review
worker_classstring后台作业 worker 的类(例如:PostReceiveMergeWorker

至少需要一个属性,除了 queue_name

示例请求:

shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/admin/sidekiq/queues/authorized_projects?user=root"

示例响应:

json
{ "completed": true, "deleted_jobs": 7, "queue_size": 14 }