From 36449bb6b652dceb16d35df49cbca333ddca8878 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Tue, 2 Aug 2016 14:18:26 -0700 Subject: [PATCH 1/2] Account for both types of timeouts in retry logic --- app/models/SuperModel.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/SuperModel.coffee b/app/models/SuperModel.coffee index ea8058f79..d3feb3314 100644 --- a/app/models/SuperModel.coffee +++ b/app/models/SuperModel.coffee @@ -309,7 +309,7 @@ class ModelResource extends Resource console.log "Didn't load model in #{timeToWait}ms (attempt ##{@loadsAttempted}), trying again: ", this @fetchModel() @listenTo @model, 'error', (levelComponent, request) -> - if request.status isnt 504 + if request.status not in [504, 524] clearTimeout(@timeoutID) clearTimeout(@timeoutID) if @timeoutID @timeoutID = setTimeout(tryLoad, timeToWait) From 5dc3ebe9b1c1b7b34024c9eae4fe597bb73dcb21 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Tue, 2 Aug 2016 14:25:14 -0700 Subject: [PATCH 2/2] Include other timeout error codes for good measure --- app/models/SuperModel.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/SuperModel.coffee b/app/models/SuperModel.coffee index d3feb3314..45c555e60 100644 --- a/app/models/SuperModel.coffee +++ b/app/models/SuperModel.coffee @@ -309,7 +309,7 @@ class ModelResource extends Resource console.log "Didn't load model in #{timeToWait}ms (attempt ##{@loadsAttempted}), trying again: ", this @fetchModel() @listenTo @model, 'error', (levelComponent, request) -> - if request.status not in [504, 524] + if request.status not in [408, 504, 522, 524] clearTimeout(@timeoutID) clearTimeout(@timeoutID) if @timeoutID @timeoutID = setTimeout(tryLoad, timeToWait)