Chore: fix functions names
This commit is contained in:
@@ -28,7 +28,7 @@ export class CachingProxy {
|
|||||||
/**
|
/**
|
||||||
* Wrap request to prevent multiple calls with same params when request is waiting for response.
|
* 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]) {
|
if (!this.promises[funcName]) {
|
||||||
this.promises[funcName] = {};
|
this.promises[funcName] = {};
|
||||||
}
|
}
|
||||||
@@ -36,9 +36,9 @@ export class CachingProxy {
|
|||||||
return callOnce(func, promiseKeeper, funcScope);
|
return callOnce(func, promiseKeeper, funcScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyfyWithCache(func, funcName, funcScope) {
|
proxifyWithCache(func, funcName, funcScope) {
|
||||||
const proxyfied = this.proxyfy(func, funcName, funcScope);
|
const proxified = this.proxify(func, funcName, funcScope);
|
||||||
return this.cacheRequest(proxyfied, funcName, funcScope);
|
return this.cacheRequest(proxified, funcName, funcScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
_isExpired(cacheObject) {
|
_isExpired(cacheObject) {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export class Zabbix implements ZabbixConnector {
|
|||||||
|
|
||||||
this.zabbixAPI = new ZabbixAPIConnector(basicAuth, withCredentials, datasourceId);
|
this.zabbixAPI = new ZabbixAPIConnector(basicAuth, withCredentials, datasourceId);
|
||||||
|
|
||||||
this.proxyfyRequests();
|
this.proxifyRequests();
|
||||||
this.cacheRequests();
|
this.cacheRequests();
|
||||||
this.bindRequests();
|
this.bindRequests();
|
||||||
|
|
||||||
@@ -87,8 +87,8 @@ export class Zabbix implements ZabbixConnector {
|
|||||||
const connectorOptions: any = { dbConnectionRetentionPolicy };
|
const connectorOptions: any = { dbConnectionRetentionPolicy };
|
||||||
this.initDBConnector(dbConnectionDatasourceId, dbConnectionDatasourceName, connectorOptions)
|
this.initDBConnector(dbConnectionDatasourceId, dbConnectionDatasourceName, connectorOptions)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getHistoryDB = this.cachingProxy.proxyfyWithCache(this.dbConnector.getHistory, 'getHistory', this.dbConnector);
|
this.getHistoryDB = this.cachingProxy.proxifyWithCache(this.dbConnector.getHistory, 'getHistory', this.dbConnector);
|
||||||
this.getTrendsDB = this.cachingProxy.proxyfyWithCache(this.dbConnector.getTrends, 'getTrends', 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) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user