diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-03-09 08:57:55 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-03-09 08:57:55 +0900 |
| commit | c3344fbd68440d31d9e93fc260980558d6aed00a (patch) | |
| tree | 443465f4dc1bbf8bce47aa793a0ee053f366ae8f /src/queue/index.ts | |
| parent | Increase job attempts limit a little (diff) | |
| download | sharkey-c3344fbd68440d31d9e93fc260980558d6aed00a.tar.gz sharkey-c3344fbd68440d31d9e93fc260980558d6aed00a.tar.bz2 sharkey-c3344fbd68440d31d9e93fc260980558d6aed00a.zip | |
To retry AP deliver queue (#4457)
Diffstat (limited to 'src/queue/index.ts')
| -rw-r--r-- | src/queue/index.ts | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/queue/index.ts b/src/queue/index.ts index b4067cd7ce..db1344d2e1 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -25,6 +25,26 @@ export const deliverQueue = initializeQueue('deliver'); export const inboxQueue = initializeQueue('inbox'); export const dbQueue = initializeQueue('db'); +deliverQueue + .on('waiting', (jobId) => { + queueLogger.debug(`[deliver] waiting id=${jobId}`); + }) + .on('active', (job) => { + queueLogger.debug(`[deliver] active id=${job.id} to=${job.data.to}`); + }) + .on('completed', (job, result) => { + queueLogger.debug(`[deliver] completed(${result}) id=${job.id} to=${job.data.to}`); + }) + .on('failed', (job, err) => { + queueLogger.debug(`[deliver] failed(${err}) id=${job.id} to=${job.data.to}`); + }) + .on('error', (error) => { + queueLogger.error(`[deliver] error ${error}`); + }) + .on('stalled', (job) => { + queueLogger.warn(`[deliver] stalled id=${job.id} to=${job.data.to}`); + }); + export function deliver(user: ILocalUser, content: any, to: any) { if (content == null) return null; @@ -38,7 +58,7 @@ export function deliver(user: ILocalUser, content: any, to: any) { attempts: 8, backoff: { type: 'exponential', - delay: 1000 + delay: 60 * 1000 }, removeOnComplete: true, removeOnFail: true |