speed up when no feeds to update

This commit is contained in:
Jean-Christian Paul Denis 2022-12-11 00:07:50 +01:00
parent a28113eca6
commit c29fa6fc91
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -426,9 +426,7 @@ class zoneclearFeedServer
return false;
}
# Set feeds user
$this->enableUser(true);
$enabled = false;
$updates = false;
$loop_mem = [];
@ -443,9 +441,14 @@ class zoneclearFeedServer
while ($f->fetch()) {
# Check if feed need update
if ($id || $i < $limit && $f->feed_status == 1
&& $time > $f->feed_upd_last + $f->feed_upd_int
if ($id
|| $i < $limit && $f->feed_status == 1 && ($time > $f->feed_upd_last + $f->feed_upd_int)
) {
if (!$enabled) {
# Set feeds user
$this->enableUser(true);
$enabled = true;
}
$i++;
$feed = self::readFeed($f->feed_feed);
@ -693,7 +696,9 @@ class zoneclearFeedServer
}
}
}
if ($enabled) {
$this->enableUser(false);
}
$this->unlockUpdate();
return true;