From cb54fc0ed2d5457af09afd1e8da7a00e585a932a Mon Sep 17 00:00:00 2001 From: Khurshid Fayzullaev Date: Wed, 16 Sep 2015 20:39:48 -0400 Subject: [PATCH] Services: Do not create the atStopCache cache for AtStopService if it is there already; --- www/js/services.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/www/js/services.js b/www/js/services.js index 7d12f898..320fee8d 100644 --- a/www/js/services.js +++ b/www/js/services.js @@ -386,12 +386,14 @@ angular.module('atstop.services', ['ionic', 'configuration']) .factory('AtStopService', function($q, $http, $filter, httpTimeout, CacheFactory, datetimeService, API_END_POINT, API_KEY) { - CacheFactory('atStopCache', { - maxAge: 10000, // Items added to this cache expire after 10s - cacheFlushInterval: 60 * 60 * 1000, // This cache will clear itself every hour - deleteOnExpire: 'aggressive' // Items will be deleted from this cache when they expire - }); - + if (!CacheFactory.get('dataCache')) { + CacheFactory('atStopCache', { + maxAge: 10000, // Items added to this cache expire after 10s + cacheFlushInterval: 60 * 60 * 1000, // This cache will clear itself every hour + deleteOnExpire: 'aggressive' // Items will be deleted from this cache when they expire + }); + } + var getBuses = function(params) { var stop; if (params.hasOwnProperty('stop')) {