mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-17 19:12:33 -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
|
||||
# * 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
|
||||
|
||||
constructor: (options) ->
|
||||
|
|
|
@ -298,6 +298,10 @@ class ModelResource extends Resource
|
|||
@loadsAttempted = 0
|
||||
|
||||
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
|
||||
tryLoad = =>
|
||||
return if this.isLoaded
|
||||
|
|
Loading…
Reference in a new issue