Chore: fix functions names

This commit is contained in:
Alexander Zobnin
2020-08-06 15:26:16 +03:00
parent 47bbf55e54
commit 21c8bc21b3
2 changed files with 9 additions and 9 deletions

View File

@@ -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) {

View File

@@ -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);
}
}