forked from FoundKeyGang/FoundKey
backend: fixup missing deadTime and incorrect import
This commit is contained in:
parent
21c1e5c06c
commit
d762143b89
1 changed files with 2 additions and 1 deletions
|
@ -13,7 +13,7 @@ import { Instance } from '@/models/entities/instance.js';
|
||||||
import { StatusError } from '@/misc/fetch.js';
|
import { StatusError } from '@/misc/fetch.js';
|
||||||
import { DeliverJobData } from '@/queue/types.js';
|
import { DeliverJobData } from '@/queue/types.js';
|
||||||
import { LessThan } from 'typeorm';
|
import { LessThan } from 'typeorm';
|
||||||
import { DAY } from '@/const.ts';
|
import { DAY } from '@/const.js';
|
||||||
|
|
||||||
const logger = new Logger('deliver');
|
const logger = new Logger('deliver');
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ export default async (job: Bull.Job<DeliverJobData>) => {
|
||||||
return 'skip (blocked)';
|
return 'skip (blocked)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deadTime = new Date(Date.now() - deadThreshold);
|
||||||
const isSuspendedOrDead = await Instances.countBy([
|
const isSuspendedOrDead = await Instances.countBy([
|
||||||
{ host: puny, isSuspended: true },
|
{ host: puny, isSuspended: true },
|
||||||
{ host: puny, lastCommunicatedAt: LessThan(deadTime) },
|
{ host: puny, lastCommunicatedAt: LessThan(deadTime) },
|
||||||
|
|
Loading…
Reference in a new issue