diff options
Diffstat (limited to 'js/public/app.js')
-rw-r--r-- | js/public/app.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/js/public/app.js b/js/public/app.js index 4f44689c3..e11c2e976 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -41,14 +41,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return $provide.value('Config', config = { markReadTimeout: 500, scrollTimeout: 500, - feedUpdateInterval: 6000000, + feedUpdateInterval: 600000, itemBatchSize: 20 }); }); angular.module('News').run([ - 'Persistence', function(Persistence) { - return Persistence.init(); + 'Persistence', 'Config', 'FeedBl', function(Persistence, Config, FeedBl) { + Persistence.init(); + return setInterval(function() { + return FeedBl.updateFeeds(); + }, Config.feedUpdateInterval); } ]); @@ -800,6 +803,22 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return this._feedModel.removeByUrlHash(urlHash); }; + FeedBl.prototype.updateFeeds = function() { + var feed, _i, _len, _ref, _results; + + _ref = this._feedModel.getAll(); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + feed = _ref[_i]; + if (angular.isDefined(feed.id)) { + _results.push(this._persistence.updateFeed(feed.id)); + } else { + _results.push(void 0); + } + } + return _results; + }; + return FeedBl; })(_Bl); |