|
|
|
|
@@ -65,21 +65,21 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
|
|
|
|
|
this.followingsRepository.createQueryBuilder('following')
|
|
|
|
|
.select('COUNT(DISTINCT following.followeeHost)')
|
|
|
|
|
.where('following.followeeHost IS NOT NULL')
|
|
|
|
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT IN (:...blocked)', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
|
|
|
|
.getRawOne()
|
|
|
|
|
.then(x => parseInt(x.count, 10)),
|
|
|
|
|
this.followingsRepository.createQueryBuilder('following')
|
|
|
|
|
.select('COUNT(DISTINCT following.followerHost)')
|
|
|
|
|
.where('following.followerHost IS NOT NULL')
|
|
|
|
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followerHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followerHost NOT IN (:...blocked)', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere(`following.followerHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
|
|
|
|
.getRawOne()
|
|
|
|
|
.then(x => parseInt(x.count, 10)),
|
|
|
|
|
this.followingsRepository.createQueryBuilder('following')
|
|
|
|
|
.select('COUNT(DISTINCT following.followeeHost)')
|
|
|
|
|
.where('following.followeeHost IS NOT NULL')
|
|
|
|
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT IN (:...blocked)', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
|
|
|
|
.andWhere(`following.followeeHost IN (${ pubsubSubQuery.getQuery() })`)
|
|
|
|
|
.setParameters(pubsubSubQuery.getParameters())
|
|
|
|
|
@@ -88,7 +88,7 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
|
|
|
|
|
this.instancesRepository.createQueryBuilder('instance')
|
|
|
|
|
.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(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT IN (:...blocked)', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere('instance.isSuspended = false')
|
|
|
|
|
.andWhere('instance.isNotResponding = false')
|
|
|
|
|
.getRawOne()
|
|
|
|
|
@@ -96,7 +96,7 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
|
|
|
|
|
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(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT IN (:...blocked)', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
|
|
|
|
.andWhere('instance.isSuspended = false')
|
|
|
|
|
.andWhere('instance.isNotResponding = false')
|
|
|
|
|
.getRawOne()
|
|
|
|
|
|