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:
evazion
2020-03-06 22:44:39 -06:00
parent d344005f8f
commit 2e0ad42eca

View File

@@ -107,7 +107,7 @@ module PaginationExtension
@paginator_count ||= unscoped.from(except(:offset, :limit, :order).reorder(nil)).count
rescue ActiveRecord::StatementInvalid => e
if e.to_s =~ /statement timeout/
1_000_000
@paginator_count ||= 1_000_000
else
raise
end