aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-11 10:48:58 +0200
committerChocobozzz <me@florianbigard.com>2020-05-11 10:53:06 +0200
commit95cd31f1fe3311c873bee8185e6b07398a775a47 (patch)
tree0be01dcca9f29309cf74ab575a9efec34b689471 /server/lib/schedulers
parent3a1a00a4af866caa96355c6702bbf805685d0973 (diff)
downloadPeerTube-95cd31f1fe3311c873bee8185e6b07398a775a47.tar.gz
PeerTube-95cd31f1fe3311c873bee8185e6b07398a775a47.tar.zst
PeerTube-95cd31f1fe3311c873bee8185e6b07398a775a47.zip
Allow to auto follow a specific URL
Diffstat (limited to 'server/lib/schedulers')
-rw-r--r--server/lib/schedulers/auto-follow-index-instances.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/lib/schedulers/auto-follow-index-instances.ts b/server/lib/schedulers/auto-follow-index-instances.ts
index e852c7fc6..a57436a45 100644
--- a/server/lib/schedulers/auto-follow-index-instances.ts
+++ b/server/lib/schedulers/auto-follow-index-instances.ts
@@ -42,6 +42,10 @@ export class AutoFollowIndexInstances extends AbstractScheduler {
42 this.lastCheck = new Date() 42 this.lastCheck = new Date()
43 43
44 const { body } = await doRequest<any>({ uri, qs, json: true }) 44 const { body } = await doRequest<any>({ uri, qs, json: true })
45 if (!body.data || Array.isArray(body.data) === false) {
46 logger.error('Cannot auto follow instances of index %s: bad URL format. Please check the auto follow URL.', indexUrl)
47 return
48 }
45 49
46 const hosts: string[] = body.data.map(o => o.host) 50 const hosts: string[] = body.data.map(o => o.host)
47 const chunks = chunk(hosts, 20) 51 const chunks = chunk(hosts, 20)