mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
comments about optimistic loading
This commit is contained in:
parent
b9b0596d83
commit
a2ac37ac99
1 changed files with 3 additions and 0 deletions
|
@ -65,6 +65,7 @@ module.exports = DocManager =
|
|||
callback(null, docs)
|
||||
|
||||
getAllNonDeletedDocs: (project_id, filter, callback = (error, docs) ->) ->
|
||||
# load docs optimistically, only unarchive if results are incomplete
|
||||
DocManager._getAllDocs project_id, filter, (error, docs) ->
|
||||
return callback(error) if error?
|
||||
# check if any docs have been archived
|
||||
|
@ -74,8 +75,10 @@ module.exports = DocManager =
|
|||
if error?
|
||||
logger.err err:error, project_id:project_id, "error unarchiving docs"
|
||||
return callback(error)
|
||||
# now reload the docs after unarchiving
|
||||
DocManager._getAllDocs project_id, filter, callback
|
||||
else
|
||||
# return docs immediately, nothing in s3
|
||||
return callback(null, docs)
|
||||
|
||||
updateDoc: (project_id, doc_id, lines, version, ranges, callback = (error, modified, rev) ->) ->
|
||||
|
|
Loading…
Reference in a new issue