Skip to content

Commit

Permalink
Services: Do not create the atStopCache cache for AtStopService if it…
Browse files Browse the repository at this point in the history
… is there already;
  • Loading branch information
khfayzullaev committed Sep 17, 2015
1 parent 8d9f79e commit cb54fc0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit cb54fc0

Please sign in to comment.