const uri = indexUrl + INSTANCES_INDEX.HOSTS_PATH
- const qs = this.lastCheck ? { since: this.lastCheck.toISOString() } : {}
+ const qs = { count: 1000 }
+ if (this.lastCheck) Object.assign(qs, { since: this.lastCheck.toISOString() })
+
this.lastCheck = new Date()
- const { body } = await doRequest({ uri, qs, json: true })
+ const { body } = await doRequest<any>({ uri, qs, json: true })
const hosts: string[] = body.data.map(o => o.host)
const chunks = chunk(hosts, 20)
isAutoFollow: true
}
- await JobQueue.Instance.createJob({ type: 'activitypub-follow', payload })
- .catch(err => logger.error('Cannot create follow job for %s.', unfollowedHost, err))
+ JobQueue.Instance.createJob({ type: 'activitypub-follow', payload })
}
}