]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/schedulers/auto-follow-index-instances.ts
Add overview of a user's actions in user-edit (#2558)
[github/Chocobozzz/PeerTube.git] / server / lib / schedulers / auto-follow-index-instances.ts
index ef11fc87f944a781db0147a6bb50aaf8c201ca58..a1f5e4a916800d5cf34e065705e53dbc7f133793 100644 (file)
@@ -36,10 +36,12 @@ 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 })
+      const { body } = await doRequest<any>({ uri, qs, json: true })
 
       const hosts: string[] = body.data.map(o => o.host)
       const chunks = chunk(hosts, 20)
@@ -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 })
         }
       }