apostrophe-rss
Advanced tools
Comparing version 0.5.18 to 0.5.19
13
index.js
@@ -87,5 +87,6 @@ var feedparser = require('feedparser'); | ||
// AJAX request. | ||
if (cache[key]) { | ||
if (self.currentInCache(key, Date.now())) { | ||
return self.loadFeed(item, callback); | ||
} | ||
return self.loadFeed(item, callback); | ||
// It's not in the cache. Mark it as needing to be | ||
@@ -105,5 +106,9 @@ // loaded by the browser so we don't block the | ||
self.currentInCache = function(key, now) { | ||
return cache[key] && ((cache[key].when + lifetime) > now); | ||
}; | ||
// Load the feed. Shared by self.load and the render-feed route | ||
self.loadFeed = function(item, callback) { | ||
// Asynchronously load the actual RSS feed | ||
@@ -121,3 +126,3 @@ // The properties you add should start with an _ to denote that | ||
// If we already have it, deliver it | ||
if (cache[key] && ((cache[key].when + lifetime) > now)) { | ||
if (self.currentInCache(key, now)) { | ||
item._entries = cache[key].data; | ||
@@ -128,3 +133,3 @@ item._failed = cache[key].failed; | ||
// If we're already waiting for it, wait for it | ||
// If we're already waiting for it, join the queue | ||
if (pending[key]) { | ||
@@ -131,0 +136,0 @@ pending[key].push({ |
{ | ||
"name": "apostrophe-rss", | ||
"version": "0.5.18", | ||
"version": "0.5.19", | ||
"description": "Adds an RSS feed widget to the Apostrophe content management system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# apostrophe-rss | ||
apostrophe-rss is a simple RSS feed display widget for the [Apostrophe](http://apostrophenow.org) content management system. | ||
NOT CURRENTLY FOR NEW PROJECTS | ||
apostrophe-rss is a simple RSS feed display widget for the [Apostrophe](http://apostrophenow.org) content management system. It is currently intended for version 0.5.x. Feel free to contribute a port to 2.x, as the caching logic and general strategy here is good. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10910
205
8