From e0ce715a1ded6e84c877004dae3e354c8716fb06 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Jul 2019 14:52:24 +0200 Subject: Check latest plugins version --- server/lib/plugins/plugin-index.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'server/lib/plugins/plugin-index.ts') diff --git a/server/lib/plugins/plugin-index.ts b/server/lib/plugins/plugin-index.ts index 4a8a90ec8..63cd47e63 100644 --- a/server/lib/plugins/plugin-index.ts +++ b/server/lib/plugins/plugin-index.ts @@ -27,13 +27,18 @@ async function listAvailablePluginsFromIndex (options: PeertubePluginIndexList) const uri = CONFIG.PLUGINS.INDEX.URL + '/api/v1/plugins' - const { body } = await doRequest({ uri, qs, json: true }) + try { + const { body } = await doRequest({ uri, qs, json: true }) - logger.debug('Got result from PeerTube index.', { body }) + logger.debug('Got result from PeerTube index.', { body }) - await addInstanceInformation(body) + await addInstanceInformation(body) - return body as ResultList + return body as ResultList + } catch (err) { + logger.error('Cannot list available plugins from index %s.', uri, { err }) + return undefined + } } async function addInstanceInformation (result: ResultList) { @@ -53,7 +58,7 @@ async function getLatestPluginsVersion (npmNames: string[]): Promise