Streams are newest first also

Keep the beginning when limited:
Newest, ..., Oldest

Reverse direction when adding to the queue:
Oldest, ..., Newest

This way when it is limited by queue size,
we keep the newest streams for indexing.
This commit is contained in:
tcely 2025-05-20 02:57:02 -04:00 committed by GitHub
parent e135da45ca
commit 3c1cf294eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -552,7 +552,7 @@ class Source(db.models.Model):
entries.maxlen // 2, entries.maxlen // 2,
entries.maxlen - len(entries), entries.maxlen - len(entries),
) )
entries.extend(reversed(streams[-1 * allowed_streams :])) entries.extend(reversed(streams[: allowed_streams]))
return entries return entries