mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 17:16:03 +02:00
fix(core): remove cache onExpire event, because work not fine
This commit is contained in:
4
config/env/torrents.js
vendored
4
config/env/torrents.js
vendored
@@ -169,13 +169,11 @@ module.exports = {
|
||||
* @maxAge: The number of milliseconds until a newly inserted item expires
|
||||
* @recycleFreq: Determines how often a cache will scan for expired items
|
||||
* @storageMode: Determines the storage medium used by a cache, value of 'memory', 'localStorage' and 'sessionStorage'
|
||||
* @refreshOnExpire: refresh data on expire
|
||||
*/
|
||||
cache: {
|
||||
maxAge: 60 * 1000 * 1,
|
||||
recycleFreq: 60 * 1000,
|
||||
storageMode: 'memory',
|
||||
refreshOnExpire: true
|
||||
storageMode: 'localStorage'
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -195,15 +195,7 @@
|
||||
maxAge: cacheConfig.maxAge,
|
||||
recycleFreq: cacheConfig.recycleFreq,
|
||||
deleteOnExpire: 'aggressive',
|
||||
storageMode: cacheConfig.storageMode,
|
||||
onExpire: function (key, value) {
|
||||
if (cacheConfig.refreshOnExpire) {
|
||||
var _this = this; // "this" is the cache in which the item expired
|
||||
angular.injector(['ng']).get('$http').get(key).success(function (data) {
|
||||
_this.put(key, data);
|
||||
});
|
||||
}
|
||||
}
|
||||
storageMode: cacheConfig.storageMode
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user