From e124838e34ff2d393ef025bd203a1062a203fd53 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 28 Jan 2016 19:16:14 +0300 Subject: [PATCH] Initialize cache only if needed. --- plugins/datasource-zabbix/zabbixCache.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/datasource-zabbix/zabbixCache.js b/plugins/datasource-zabbix/zabbixCache.js index 2a73773..ad1c9ce 100644 --- a/plugins/datasource-zabbix/zabbixCache.js +++ b/plugins/datasource-zabbix/zabbixCache.js @@ -13,8 +13,6 @@ function (angular, _, utils) { module.factory('ZabbixCache', function($q) { function ZabbixCache(zabbixAPI, ttl) { - var self = this; - this.zabbixAPI = zabbixAPI; this.ttl = ttl; @@ -26,11 +24,6 @@ function (angular, _, utils) { // Check is a service initialized or not this._initialized = undefined; - - // Set _initialized when data has loaded - this.refresh().then(function () { - self._initialized = true; - }); } var p = ZabbixCache.prototype; @@ -51,6 +44,7 @@ function (angular, _, utils) { self._applications = convertApplications(results[2]); self._items = convertItems(results[3]); } + self._initialized = true; }); };