pagination: fix page count timeouts not being cached.
Bug: if there was a timeout when calculating the page count, the timeout wouldn't be cached, so we would hit multiple timeouts trying to calculate the page count multiple times.
This commit is contained in:
@@ -107,7 +107,7 @@ module PaginationExtension
|
|||||||
@paginator_count ||= unscoped.from(except(:offset, :limit, :order).reorder(nil)).count
|
@paginator_count ||= unscoped.from(except(:offset, :limit, :order).reorder(nil)).count
|
||||||
rescue ActiveRecord::StatementInvalid => e
|
rescue ActiveRecord::StatementInvalid => e
|
||||||
if e.to_s =~ /statement timeout/
|
if e.to_s =~ /statement timeout/
|
||||||
1_000_000
|
@paginator_count ||= 1_000_000
|
||||||
else
|
else
|
||||||
raise
|
raise
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user