mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Tweak initialSync logic to ensure we don't get perform it forever
Before this no entries were saved after an initialSync, making us thing it's an initialSync every time.
This commit is contained in:
parent
428ca02456
commit
2d712be3c0
@ -118,12 +118,14 @@ export class FeedReader {
|
||||
try {
|
||||
const res = await axios.get(url.toString());
|
||||
const feed = await (new Parser()).parseString(res.data);
|
||||
const seenGuids = this.seenEntries.get(url) || [];
|
||||
const seenGuidsSet = new Set(seenGuids);
|
||||
let initialSync = false;
|
||||
if (seenGuidsSet.size === 0) {
|
||||
let seenGuids = this.seenEntries.get(url);
|
||||
if (!seenGuids) {
|
||||
initialSync = true;
|
||||
seenGuids = [];
|
||||
seenEntriesChanged = true; // to ensure we only treat it as an initialSync once
|
||||
}
|
||||
const seenGuidsSet = new Set(seenGuids);
|
||||
const newGuids = [];
|
||||
log.debug(`Found ${feed.items.length} entries in ${url}`);
|
||||
for (const item of feed.items) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user