aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre.alapetite@alexandra.dk> 2016-10-05 17:48:24 +0200
committerGravatar Alexandre Alapetite <alexandre.alapetite@alexandra.dk> 2016-10-05 17:48:24 +0200
commitfe65eec5bbdaee37177e3673e31e241b1f1b938d (patch)
treef3869c4691ddf8723fddbe6640729881cb1b2665 /app/Controllers/feedController.php
parent9e34d7275eb936e1a08b872aca7adbce5a5674c5 (diff)
Better multiuser update
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index d85a53446..dadc8aa83 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -271,13 +271,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
if ($ttl == -1) {
continue; //Feed refresh is disabled
}
- if ($feed->lastUpdate() < time() + 60 - ($ttl == -2 ? FreshRSS_Context::$user_conf->ttl_default : $ttl)) {
+ if ($feed->lastUpdate() + 10 >= time() - ($ttl == -2 ? FreshRSS_Context::$user_conf->ttl_default : $ttl)) {
//Too early to refresh from source, but check whether the feed was updated by another user
$mtime = $feed->cacheModifiedTime();
- if ($feed->lastUpdate() >= $mtime + 10) {
+ if ($feed->lastUpdate() + 10 >= $mtime) {
continue; //Nothing newer from other users
}
- Minz_Log::debug($feed->url() . ' was recently updated by another user');
+ //Minz_Log::debug($feed->url() . ' was updated at ' . date('c', $mtime) . ' by another user');
+ //Will take advantage of the newer cache
}
if (!$feed->lock()) {
@@ -391,7 +392,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
}
- $feedDAO->updateLastUpdate($feed->id(), 0, $entryDAO->inTransaction());
+ $feedDAO->updateLastUpdate($feed->id(), false, $entryDAO->inTransaction(), $mtime);
if ($entryDAO->inTransaction()) {
$entryDAO->commit();
}