X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fschedulers%2Fauto-follow-index-instances.ts;h=d700a99f0b82257d630c3a1db7232f8aea7fb9ef;hb=8cc56c7fddb4c9fe3cfe1a19f340fc07dc4cec0f;hp=ef11fc87f944a781db0147a6bb50aaf8c201ca58;hpb=8d5e65349deebd499c0be10fe02d535a77d58ddb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/schedulers/auto-follow-index-instances.ts b/server/lib/schedulers/auto-follow-index-instances.ts index ef11fc87f..d700a99f0 100644 --- a/server/lib/schedulers/auto-follow-index-instances.ts +++ b/server/lib/schedulers/auto-follow-index-instances.ts @@ -36,7 +36,9 @@ export class AutoFollowIndexInstances extends AbstractScheduler { 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 }) @@ -55,8 +57,7 @@ export class AutoFollowIndexInstances extends AbstractScheduler { 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 }) } }