mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 11:23:09 +02:00
fix(backend): ジョブキュー再試行時のタイミングずれによるエラーを抑制 (#11035)
* fix(backend): ジョブキュー再試行時のタイミングずれによるエラーを抑制 * fix lint
This commit is contained in:
parent
4f876c9e8d
commit
8ec96ad1e0
1 changed files with 22 additions and 2 deletions
|
@ -33,7 +33,17 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
delayedQueues = await this.queueService.deliverQueue.getDelayed();
|
delayedQueues = await this.queueService.deliverQueue.getDelayed();
|
||||||
for (let queueIndex = 0; queueIndex < delayedQueues.length; queueIndex++) {
|
for (let queueIndex = 0; queueIndex < delayedQueues.length; queueIndex++) {
|
||||||
const queue = delayedQueues[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;
|
break;
|
||||||
|
|
||||||
|
@ -41,7 +51,17 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
delayedQueues = await this.queueService.inboxQueue.getDelayed();
|
delayedQueues = await this.queueService.inboxQueue.getDelayed();
|
||||||
for (let queueIndex = 0; queueIndex < delayedQueues.length; queueIndex++) {
|
for (let queueIndex = 0; queueIndex < delayedQueues.length; queueIndex++) {
|
||||||
const queue = delayedQueues[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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue