Increase pet loading timeout

This commit is contained in:
Emi Matchu 2024-01-23 22:10:42 -08:00
parent 76af587e7c
commit 44d9f98313
2 changed files with 4 additions and 2 deletions

View file

@ -8,7 +8,6 @@ class PetsController < ApplicationController
@pet = Pet.load(
params[:name],
:item_scope => Item.includes(:translations),
:timeout => 1
)
points = contribute(current_user, @pet)

View file

@ -44,7 +44,10 @@ class Pet < ApplicationRecord
options[:item_scope])
end
def fetch_viewer_data(timeout=4, locale=nil)
# NOTE: Ideally pet requests shouldn't take this long, but Neopets can be
# slow sometimes! Since we're on the Falcon server, long timeouts shouldn't
# slow down the rest of the request queue, like it used to be in the past.
def fetch_viewer_data(timeout=10, locale=nil)
locale ||= I18n.default_locale
begin
neopets_language_code = I18n.compatible_neopets_language_code_for(locale)