FIX: Ensure sitemaps include all topics with no duplicates (#26289)
We were using `OFFSET`/`LIMIT` to query topics without an 'ORDER'. Without an explicit order, postgres makes no guarantees about which rows will be returned for each query. This commit adds `ORDER BY id ASC` so that our sitemaps behave consistently.
This commit is contained in:
parent
284b65e165
commit
4e082c7390
|
@ -62,7 +62,7 @@ class Sitemap < ActiveRecord::Base
|
|||
else
|
||||
offset = (name.to_i - 1) * max_page_size
|
||||
|
||||
indexable_topics.limit(max_page_size).offset(offset)
|
||||
indexable_topics.order(id: :asc).limit(max_page_size).offset(offset)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue