From 47bbf55e548337880efa5665e4b231e839702f31 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 6 Aug 2020 15:15:38 +0300 Subject: [PATCH] Fix reconnecting on request error --- src/datasource-zabbix/utils.ts | 3 +++ src/datasource-zabbix/zabbix/proxy/cachingProxy.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/datasource-zabbix/utils.ts b/src/datasource-zabbix/utils.ts index c5ba1e9..03f1c29 100644 --- a/src/datasource-zabbix/utils.ts +++ b/src/datasource-zabbix/utils.ts @@ -302,6 +302,9 @@ export function callOnce(func, promiseKeeper) { .then(result => { promiseKeeper = null; return result; + }).catch(err => { + promiseKeeper = null; + throw err; }) ); } diff --git a/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts b/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts index 5d11628..1fa78e2 100644 --- a/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts +++ b/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts @@ -65,6 +65,9 @@ function callOnce(func, promiseKeeper, funcScope) { .then(result => { promiseKeeper[hash] = null; return result; + }).catch(err => { + promiseKeeper[hash] = null; + throw err; }) ); }