Skip to content

Commit 08778ad

Browse files
Use query builder to prevent timeout (#347)
* Use query builder Prevent timeout in query when there's many entries * Use `offset`/`limit` methods instead The `skip`/`take` methods aren't available on the Stache query builder. --------- Co-authored-by: Duncan McClean <[email protected]>
1 parent bc143f9 commit 08778ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Sitemap/Sitemap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static function paginatedPages(int $page)
4545
$entryCount = $sitemap->publishedEntriesCount() - 1;
4646

4747
if ($offset < $entryCount) {
48-
$entries = $sitemap->publishedEntries()->skip($offset)->take($perPage);
48+
$entries = $sitemap->publishedEntriesQuery()->offset($offset)->limit($perPage)->get();
4949

5050
if ($entries->count() < $remaining) {
5151
$remaining -= $entries->count();

0 commit comments

Comments
 (0)