Iterator subs = getAllSubscriptions();
while (subs.hasNext()) {
long subStartTime = System.currentTimeMillis();
PlanetSubscriptionData sub = (PlanetSubscriptionData)subs.next();
// reattach sub. sub gets detached as we iterate
sub = this.getSubscriptionById(sub.getId());
// Fetch latest entries for each subscription
// Set newEntries = null;
// int count = 0;
// if (!StringUtils.isEmpty(localURL) && sub.getFeedURL().startsWith(localURL)) {
// newEntries = getNewEntriesLocal(sub, feedFetcher, feedInfoCache);
// } else {
// newEntries = getNewEntriesRemote(sub, feedFetcher, feedInfoCache);
// }
Set newEntries = this.getNewEntries(sub, feedFetcher, feedInfoCache);
int count = newEntries.size();
log.debug(" Entry count: " + count);
if (count > 0) {
sub.purgeEntries();
sub.addEntries(newEntries);
this.saveSubscription(sub);
if(roller != null) roller.flush();
}
long subEndTime = System.currentTimeMillis();
log.info(" " + count + " - "
+ ((subEndTime-subStartTime)/1000.0)
+ " seconds to process (" + count + ") entries of "
+ sub.getFeedURL());
}
// Clear the aggregation cache
clearCachedAggregations();
long endTime = System.currentTimeMillis();