diff --git a/packages/backend/src/misc/skipped-instances.ts b/packages/backend/src/misc/skipped-instances.ts index 3d3d333b8..3f13a8f7a 100644 --- a/packages/backend/src/misc/skipped-instances.ts +++ b/packages/backend/src/misc/skipped-instances.ts @@ -1,4 +1,5 @@ import { Brackets } from 'typeorm'; +import { db } from '@/db/postgre.js'; import { fetchMeta } from '@/misc/fetch-meta.js'; import { Instances } from '@/models/index.js'; import { Instance } from '@/models/entities/instance.js'; @@ -25,19 +26,16 @@ export async function skippedInstances(hosts: Array): Array !skipped.includes(host)), - }) - .andWhere(new Brackets(qb => { qb - .where('instance.isSuspended') - .orWhere('instance.lastCommunicatedAt < :deadTime', { deadTime }) - .orWhere('instance.latestStatus = 410'); - })) - .select('host') - .getRawMany() + hosts.filter(host => !skipped.includes(host) && !host.includes(',')).join(','), + ], + ) + .then(res => res.map(row => row.host)) ); }