From d762143b892399340d23a3697ee20aa317985084 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Sun, 16 Oct 2022 09:32:01 -0400 Subject: [PATCH] backend: fixup missing deadTime and incorrect import --- packages/backend/src/queue/processors/deliver.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/queue/processors/deliver.ts b/packages/backend/src/queue/processors/deliver.ts index 67cb2fe60..1f99b305d 100644 --- a/packages/backend/src/queue/processors/deliver.ts +++ b/packages/backend/src/queue/processors/deliver.ts @@ -13,7 +13,7 @@ import { Instance } from '@/models/entities/instance.js'; import { StatusError } from '@/misc/fetch.js'; import { DeliverJobData } from '@/queue/types.js'; import { LessThan } from 'typeorm'; -import { DAY } from '@/const.ts'; +import { DAY } from '@/const.js'; const logger = new Logger('deliver'); @@ -31,6 +31,7 @@ export default async (job: Bull.Job) => { return 'skip (blocked)'; } + const deadTime = new Date(Date.now() - deadThreshold); const isSuspendedOrDead = await Instances.countBy([ { host: puny, isSuspended: true }, { host: puny, lastCommunicatedAt: LessThan(deadTime) },