mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-01-05 12:12:26 -05:00
Add some comments and a TODO for the supermodel retrying system
This commit is contained in:
parent
2287c4f1e5
commit
f4c0e4144e
2 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,9 @@ LOG = false
|
||||||
# * Sprite map generation
|
# * Sprite map generation
|
||||||
# * Connecting to Firebase
|
# * Connecting to Firebase
|
||||||
|
|
||||||
|
# LevelLoader depends on SuperModel retrying timed out requests, as these occasionally happen during play.
|
||||||
|
# If LevelLoader ever moves away from SuperModel, it will have to manage its own retries.
|
||||||
|
|
||||||
module.exports = class LevelLoader extends CocoClass
|
module.exports = class LevelLoader extends CocoClass
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
|
|
|
@ -298,6 +298,10 @@ class ModelResource extends Resource
|
||||||
@loadsAttempted = 0
|
@loadsAttempted = 0
|
||||||
|
|
||||||
load: ->
|
load: ->
|
||||||
|
# TODO: Track progress on requests and don't retry if progress was made recently.
|
||||||
|
# Probably use _.debounce and attach event listeners to xhr objects.
|
||||||
|
|
||||||
|
# This logic is for handling failed responses for level loading.
|
||||||
timeToWait = 5000
|
timeToWait = 5000
|
||||||
tryLoad = =>
|
tryLoad = =>
|
||||||
return if this.isLoaded
|
return if this.isLoaded
|
||||||
|
|
Loading…
Reference in a new issue