mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
clean up options handling
This commit is contained in:
parent
31e71854a4
commit
203e42fa4c
1 changed files with 4 additions and 1 deletions
|
@ -17,9 +17,10 @@ DocumentUpdaterHandler = require "../DocumentUpdater/DocumentUpdaterHandler"
|
||||||
module.exports = ClsiManager =
|
module.exports = ClsiManager =
|
||||||
|
|
||||||
sendRequest: (project_id, user_id, options = {}, callback) ->
|
sendRequest: (project_id, user_id, options = {}, callback) ->
|
||||||
ClsiManager.sendRequestOnce project_id, user_id, _.clone(options), (error, status, result...) ->
|
ClsiManager.sendRequestOnce project_id, user_id, options, (error, status, result...) ->
|
||||||
return callback(error) if error?
|
return callback(error) if error?
|
||||||
if status is 'conflict'
|
if status is 'conflict'
|
||||||
|
options = _.clone(options)
|
||||||
options.syncType = "full" # force full compile
|
options.syncType = "full" # force full compile
|
||||||
ClsiManager.sendRequestOnce project_id, user_id, options, callback # try again
|
ClsiManager.sendRequestOnce project_id, user_id, options, callback # try again
|
||||||
else
|
else
|
||||||
|
@ -147,6 +148,7 @@ module.exports = ClsiManager =
|
||||||
path = docPath[doc._id]
|
path = docPath[doc._id]
|
||||||
docs[path] = doc
|
docs[path] = doc
|
||||||
# send new docs but not files as those are already on the clsi
|
# send new docs but not files as those are already on the clsi
|
||||||
|
options = _.clone(options)
|
||||||
options.syncType = "incremental"
|
options.syncType = "incremental"
|
||||||
options.syncState = projectStateHash
|
options.syncState = projectStateHash
|
||||||
ClsiManager._finaliseRequest project_id, options, project, docs, [], callback
|
ClsiManager._finaliseRequest project_id, options, project, docs, [], callback
|
||||||
|
@ -154,6 +156,7 @@ module.exports = ClsiManager =
|
||||||
_buildRequestFromMongo: (project_id, options, project, projectStateHash, callback = (error, request) ->) ->
|
_buildRequestFromMongo: (project_id, options, project, projectStateHash, callback = (error, request) ->) ->
|
||||||
ClsiManager._getContentFromMongo project_id, (error, docs, files) ->
|
ClsiManager._getContentFromMongo project_id, (error, docs, files) ->
|
||||||
return callback(error) if error?
|
return callback(error) if error?
|
||||||
|
options = _.clone(options)
|
||||||
options.syncType = "full"
|
options.syncType = "full"
|
||||||
options.syncState = projectStateHash
|
options.syncState = projectStateHash
|
||||||
ClsiManager._finaliseRequest project_id, options, project, docs, files, callback
|
ClsiManager._finaliseRequest project_id, options, project, docs, files, callback
|
||||||
|
|
Loading…
Reference in a new issue