mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Optimize initial feed update
This commit is contained in:
parent
fb922e65e4
commit
c2a7ad7b19
1 changed files with 4 additions and 1 deletions
|
@ -192,7 +192,7 @@ class Feed {
|
|||
}
|
||||
if(!$found) $tentative[] = $index;
|
||||
}
|
||||
if(sizeof($tentative)) {
|
||||
if(sizeof($tentative) && sizeof($items)==sizeof($articles)) {
|
||||
// if we need to, perform a second pass on the database looking specifically for IDs and hashes of the new items
|
||||
$ids = $hashesUT = $hashesUC = $hashesTC = [];
|
||||
foreach($tentative as $index) {
|
||||
|
@ -238,6 +238,9 @@ class Feed {
|
|||
}
|
||||
if(!$found) $new[] = $index;
|
||||
}
|
||||
} else {
|
||||
// if there are no tentatively new articles and/or the number of stored articles is less than the size of the feed, don't do a second pass; assume any tentatively new items are in fact new
|
||||
$new = $tentative;
|
||||
}
|
||||
// FIXME: fetch full content when appropriate
|
||||
foreach($new as $index) {
|
||||
|
|
Loading…
Reference in a new issue