From 8ec96ad1e0860b6f673de6a2bd4cad88dfaae4e2 Mon Sep 17 00:00:00 2001 From: CyberRex Date: Sat, 8 Jul 2023 08:57:23 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E3=82=B8=E3=83=A7=E3=83=96?= =?UTF-8?q?=E3=82=AD=E3=83=A5=E3=83=BC=E5=86=8D=E8=A9=A6=E8=A1=8C=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0=E3=81=9A?= =?UTF-8?q?=E3=82=8C=E3=81=AB=E3=82=88=E3=82=8B=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E6=8A=91=E5=88=B6=20(#11035)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(backend): ジョブキュー再試行時のタイミングずれによるエラーを抑制 * fix lint --- .../api/endpoints/admin/queue/promote.ts | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts index 9140f392cd..8330d6c82f 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts @@ -33,7 +33,17 @@ export default class extends Endpoint { delayedQueues = await this.queueService.deliverQueue.getDelayed(); for (let queueIndex = 0; queueIndex < delayedQueues.length; queueIndex++) { const queue = delayedQueues[queueIndex]; - await queue.promote(); + try { + await queue.promote(); + } catch (e) { + if (e instanceof Error) { + if (e.message.indexOf('not in a delayed state') !== -1) { + throw e; + } + } else { + throw e; + } + } } break; @@ -41,7 +51,17 @@ export default class extends Endpoint { delayedQueues = await this.queueService.inboxQueue.getDelayed(); for (let queueIndex = 0; queueIndex < delayedQueues.length; queueIndex++) { const queue = delayedQueues[queueIndex]; - await queue.promote(); + try { + await queue.promote(); + } catch (e) { + if (e instanceof Error) { + if (e.message.indexOf('not in a delayed state') !== -1) { + throw e; + } + } else { + throw e; + } + } } break; }