diff --git a/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts b/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts index 1fa78e2..7a7eca4 100644 --- a/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts +++ b/src/datasource-zabbix/zabbix/proxy/cachingProxy.ts @@ -28,7 +28,7 @@ export class CachingProxy { /** * Wrap request to prevent multiple calls with same params when request is waiting for response. */ - proxyfy(func, funcName, funcScope) { + proxify(func, funcName, funcScope) { if (!this.promises[funcName]) { this.promises[funcName] = {}; } @@ -36,9 +36,9 @@ export class CachingProxy { return callOnce(func, promiseKeeper, funcScope); } - proxyfyWithCache(func, funcName, funcScope) { - const proxyfied = this.proxyfy(func, funcName, funcScope); - return this.cacheRequest(proxyfied, funcName, funcScope); + proxifyWithCache(func, funcName, funcScope) { + const proxified = this.proxify(func, funcName, funcScope); + return this.cacheRequest(proxified, funcName, funcScope); } _isExpired(cacheObject) { diff --git a/src/datasource-zabbix/zabbix/zabbix.ts b/src/datasource-zabbix/zabbix/zabbix.ts index 75e1b53..0f7d0e4 100644 --- a/src/datasource-zabbix/zabbix/zabbix.ts +++ b/src/datasource-zabbix/zabbix/zabbix.ts @@ -79,7 +79,7 @@ export class Zabbix implements ZabbixConnector { this.zabbixAPI = new ZabbixAPIConnector(basicAuth, withCredentials, datasourceId); - this.proxyfyRequests(); + this.proxifyRequests(); this.cacheRequests(); this.bindRequests(); @@ -87,8 +87,8 @@ export class Zabbix implements ZabbixConnector { const connectorOptions: any = { dbConnectionRetentionPolicy }; this.initDBConnector(dbConnectionDatasourceId, dbConnectionDatasourceName, connectorOptions) .then(() => { - this.getHistoryDB = this.cachingProxy.proxyfyWithCache(this.dbConnector.getHistory, 'getHistory', this.dbConnector); - this.getTrendsDB = this.cachingProxy.proxyfyWithCache(this.dbConnector.getTrends, 'getTrends', this.dbConnector); + this.getHistoryDB = this.cachingProxy.proxifyWithCache(this.dbConnector.getHistory, 'getHistory', this.dbConnector); + this.getTrendsDB = this.cachingProxy.proxifyWithCache(this.dbConnector.getTrends, 'getTrends', this.dbConnector); }); } } @@ -107,9 +107,9 @@ export class Zabbix implements ZabbixConnector { }); } - proxyfyRequests() { + proxifyRequests() { for (const request of REQUESTS_TO_PROXYFY) { - this.zabbixAPI[request] = this.cachingProxy.proxyfy(this.zabbixAPI[request], request, this.zabbixAPI); + this.zabbixAPI[request] = this.cachingProxy.proxify(this.zabbixAPI[request], request, this.zabbixAPI); } }