Skip to content

Commit

Permalink
fix(backend): use sustensionState instead of isSuspended
Browse files Browse the repository at this point in the history
  • Loading branch information
tai-cha committed Jun 6, 2024
1 parent 8f833d7 commit 89973c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/backend/src/core/chart/charts/federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di

const suspendedInstancesQuery = this.instancesRepository.createQueryBuilder('instance')
.select('instance.host')
.where('instance.isSuspended = true');
.where('instance.suspensionState != \'none\'');

const pubsubSubQuery = this.followingsRepository.createQueryBuilder('f')
.select('f.followerHost')
Expand Down Expand Up @@ -89,15 +89,15 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
.select('COUNT(instance.id)')
.where(`instance.host IN (${ subInstancesQuery.getQuery() })`)
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
.andWhere('instance.isSuspended = false')
.andWhere('instance.suspensionState = \'none\'')
.andWhere('instance.isNotResponding = false')
.getRawOne()
.then(x => parseInt(x.count, 10)),
this.instancesRepository.createQueryBuilder('instance')
.select('COUNT(instance.id)')
.where(`instance.host IN (${ pubInstancesQuery.getQuery() })`)
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
.andWhere('instance.isSuspended = false')
.andWhere('instance.suspensionState = \'none\'')
.andWhere('instance.isNotResponding = false')
.getRawOne()
.then(x => parseInt(x.count, 10)),
Expand Down

0 comments on commit 89973c8

Please sign in to comment.