ZabbixAPI: improved requests caching. Cache groups, hosts, apps and items.

This commit is contained in:
Alexander Zobnin
2016-11-14 22:28:37 +03:00
parent d15e9c8acd
commit f56c4c66d6
2 changed files with 59 additions and 34 deletions

View File

@@ -18,7 +18,11 @@ function ZabbixFactory(zabbixAPIService, ZabbixCachingProxy) {
this.zabbixAPI = new ZabbixAPI(url, username, password, basicAuth, withCredentials);
// Initialize caching proxy for requests
this.cachingProxy = new ZabbixCachingProxy(this.zabbixAPI, cacheTTL);
let cacheOptions = {
enabled: true,
ttl: cacheTTL
};
this.cachingProxy = new ZabbixCachingProxy(this.zabbixAPI, cacheOptions);
// Proxy methods
this.getHistory = this.cachingProxy.getHistory.bind(this.cachingProxy);