Add queue timeout (#7519)

This commit is contained in:
MeiMei 2021-05-19 16:12:31 +09:00 committed by GitHub
parent 961b3177d5
commit 4b33c42da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,7 @@ export function deliver(user: ThinUser, content: unknown, to: string | null) {
return deliverQueue.add(data, { return deliverQueue.add(data, {
attempts: config.deliverJobMaxAttempts || 12, attempts: config.deliverJobMaxAttempts || 12,
timeout: 1 * 60 * 1000, // 1min
backoff: { backoff: {
type: 'exponential', type: 'exponential',
delay: 60 * 1000 delay: 60 * 1000
@ -88,6 +89,7 @@ export function inbox(activity: IActivity, signature: httpSignature.IParsedSigna
return inboxQueue.add(data, { return inboxQueue.add(data, {
attempts: config.inboxJobMaxAttempts || 8, attempts: config.inboxJobMaxAttempts || 8,
timeout: 5 * 60 * 1000, // 5min
backoff: { backoff: {
type: 'exponential', type: 'exponential',
delay: 60 * 1000 delay: 60 * 1000