summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/admin/queue
diff options
context:
space:
mode:
authormisskey-release-bot[bot] <157398866+misskey-release-bot[bot]@users.noreply.github.com>2025-05-31 12:37:06 +0000
committerGitHub <noreply@github.com>2025-05-31 12:37:06 +0000
commit92b9a5218db145e9bb831cefd36c309de86083b5 (patch)
tree2ebad71633f9bbacabbc193254223146f1662aee /packages/backend/src/server/api/endpoints/admin/queue
parentMerge pull request #15933 from misskey-dev/develop (diff)
parentRelease: 2025.5.1 (diff)
downloadmisskey-92b9a5218db145e9bb831cefd36c309de86083b5.tar.gz
misskey-92b9a5218db145e9bb831cefd36c309de86083b5.tar.bz2
misskey-92b9a5218db145e9bb831cefd36c309de86083b5.zip
Merge pull request #16005 from misskey-dev/develop
Release: 2025.5.1
Diffstat (limited to 'packages/backend/src/server/api/endpoints/admin/queue')
-rw-r--r--packages/backend/src/server/api/endpoints/admin/queue/jobs.ts12
-rw-r--r--packages/backend/src/server/api/endpoints/admin/queue/queue-stats.ts113
-rw-r--r--packages/backend/src/server/api/endpoints/admin/queue/queues.ts42
-rw-r--r--packages/backend/src/server/api/endpoints/admin/queue/show-job.ts7
4 files changed, 168 insertions, 6 deletions
diff --git a/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts b/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts
index 79731c9786..a68e95bf3f 100644
--- a/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts
+++ b/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts
@@ -5,7 +5,6 @@
import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
-import { ModerationLogService } from '@/core/ModerationLogService.js';
import { QUEUE_TYPES, QueueService } from '@/core/QueueService.js';
export const meta = {
@@ -14,13 +13,22 @@ export const meta = {
requireCredential: true,
requireModerator: true,
kind: 'read:admin:queue',
+
+ res: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ optional: false, nullable: false,
+ ref: 'QueueJob',
+ },
+ },
} as const;
export const paramDef = {
type: 'object',
properties: {
queue: { type: 'string', enum: QUEUE_TYPES },
- state: { type: 'array', items: { type: 'string', enum: ['active', 'wait', 'delayed', 'completed', 'failed'] } },
+ state: { type: 'array', items: { type: 'string', enum: ['active', 'wait', 'delayed', 'completed', 'failed', 'paused'] } },
search: { type: 'string' },
},
required: ['queue', 'state'],
diff --git a/packages/backend/src/server/api/endpoints/admin/queue/queue-stats.ts b/packages/backend/src/server/api/endpoints/admin/queue/queue-stats.ts
index 10ce48332a..0098160165 100644
--- a/packages/backend/src/server/api/endpoints/admin/queue/queue-stats.ts
+++ b/packages/backend/src/server/api/endpoints/admin/queue/queue-stats.ts
@@ -5,7 +5,6 @@
import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
-import { ModerationLogService } from '@/core/ModerationLogService.js';
import { QUEUE_TYPES, QueueService } from '@/core/QueueService.js';
export const meta = {
@@ -14,6 +13,118 @@ export const meta = {
requireCredential: true,
requireModerator: true,
kind: 'read:admin:queue',
+
+ res: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ name: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: QUEUE_TYPES,
+ },
+ qualifiedName: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ counts: {
+ type: 'object',
+ optional: false, nullable: false,
+ additionalProperties: {
+ type: 'number',
+ },
+ },
+ isPaused: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ metrics: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ completed: {
+ optional: false, nullable: false,
+ ref: 'QueueMetrics',
+ },
+ failed: {
+ optional: false, nullable: false,
+ ref: 'QueueMetrics',
+ },
+ },
+ },
+ db: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ version: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ mode: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['cluster', 'standalone', 'sentinel'],
+ },
+ runId: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ processId: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ port: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ os: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ uptime: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ memory: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ total: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ used: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ fragmentationRatio: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ peak: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ },
+ },
+ clients: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ blocked: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ connected: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ },
+ },
+ },
+ }
+ },
+ },
} as const;
export const paramDef = {
diff --git a/packages/backend/src/server/api/endpoints/admin/queue/queues.ts b/packages/backend/src/server/api/endpoints/admin/queue/queues.ts
index 3a38275f60..8d27e38c84 100644
--- a/packages/backend/src/server/api/endpoints/admin/queue/queues.ts
+++ b/packages/backend/src/server/api/endpoints/admin/queue/queues.ts
@@ -5,7 +5,6 @@
import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
-import { ModerationLogService } from '@/core/ModerationLogService.js';
import { QUEUE_TYPES, QueueService } from '@/core/QueueService.js';
export const meta = {
@@ -14,6 +13,47 @@ export const meta = {
requireCredential: true,
requireModerator: true,
kind: 'read:admin:queue',
+
+ res: {
+ type: 'array',
+ optional: false, nullable: false,
+ items: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ name: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: QUEUE_TYPES,
+ },
+ counts: {
+ type: 'object',
+ optional: false, nullable: false,
+ additionalProperties: {
+ type: 'number',
+ },
+ },
+ isPaused: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ metrics: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ completed: {
+ optional: false, nullable: false,
+ ref: 'QueueMetrics',
+ },
+ failed: {
+ optional: false, nullable: false,
+ ref: 'QueueMetrics',
+ },
+ },
+ },
+ },
+ },
+ },
} as const;
export const paramDef = {
diff --git a/packages/backend/src/server/api/endpoints/admin/queue/show-job.ts b/packages/backend/src/server/api/endpoints/admin/queue/show-job.ts
index 63747b5540..1735c22674 100644
--- a/packages/backend/src/server/api/endpoints/admin/queue/show-job.ts
+++ b/packages/backend/src/server/api/endpoints/admin/queue/show-job.ts
@@ -5,7 +5,6 @@
import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
-import { ModerationLogService } from '@/core/ModerationLogService.js';
import { QUEUE_TYPES, QueueService } from '@/core/QueueService.js';
export const meta = {
@@ -14,6 +13,11 @@ export const meta = {
requireCredential: true,
requireModerator: true,
kind: 'read:admin:queue',
+
+ res: {
+ optional: false, nullable: false,
+ ref: 'QueueJob',
+ },
} as const;
export const paramDef = {
@@ -28,7 +32,6 @@ export const paramDef = {
@Injectable()
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
constructor(
- private moderationLogService: ModerationLogService,
private queueService: QueueService,
) {
super(meta, paramDef, async (ps, me) => {