fix: admin/queue/deliver-delayedとadmin/queue/inbox-delayedの応答速度を改善 (#17009)

This commit is contained in:
おさむのひと 2025-12-20 19:15:05 +09:00 committed by GitHub
parent 81bacb6203
commit f739cb6270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 14 deletions

View File

@ -12,6 +12,9 @@ v2025.12.0で行われた「configの`trustProxy`のデフォルト値を`false`
### General
- 依存関係の更新
### Server
- Fix: コントロールパネルのジョブキューページで使用される一部APIの応答速度を改善
### Client
- Enhance: デッキのUI説明を追加
- Fix: バージョン表記のないPlayが正しく動作しない問題を修正

View File

@ -52,18 +52,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
super(meta, paramDef, async (ps, me) => {
const jobs = await this.deliverQueue.getJobs(['delayed']);
const res = [] as [string, number][];
const counts = new Map<string, number>();
for (const job of jobs) {
const host = new URL(job.data.to).host;
if (res.find(x => x[0] === host)) {
res.find(x => x[0] === host)![1]++;
} else {
res.push([host, 1]);
}
counts.set(host, (counts.get(host) ?? 0) + 1);
}
res.sort((a, b) => b[1] - a[1]);
const res = [...counts.entries()].sort((a, b) => b[1] - a[1]);
return res;
});

View File

@ -52,18 +52,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
super(meta, paramDef, async (ps, me) => {
const jobs = await this.inboxQueue.getJobs(['delayed']);
const res = [] as [string, number][];
const counts = new Map<string, number>();
for (const job of jobs) {
const host = new URL(job.data.signature.keyId).host;
if (res.find(x => x[0] === host)) {
res.find(x => x[0] === host)![1]++;
} else {
res.push([host, 1]);
}
counts.set(host, (counts.get(host) ?? 0) + 1);
}
res.sort((a, b) => b[1] - a[1]);
const res = [...counts.entries()].sort((a, b) => b[1] - a[1]);
return res;
});