From 95cd31f1fe3311c873bee8185e6b07398a775a47 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 May 2020 10:48:58 +0200 Subject: Allow to auto follow a specific URL --- server/lib/schedulers/auto-follow-index-instances.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/lib/schedulers') 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 { this.lastCheck = new Date() const { body } = await doRequest({ uri, qs, json: true }) + if (!body.data || Array.isArray(body.data) === false) { + logger.error('Cannot auto follow instances of index %s: bad URL format. Please check the auto follow URL.', indexUrl) + return + } const hosts: string[] = body.data.map(o => o.host) const chunks = chunk(hosts, 20) -- cgit v1.2.3