mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-21 03:03:40 +00:00
added logging
This commit is contained in:
parent
30dd9655bf
commit
ea3ee82e74
2 changed files with 3 additions and 0 deletions
|
@ -39,6 +39,7 @@ module.exports = ResourceStateManager =
|
|||
stateFile = Path.join(basePath, @SYNC_STATE_FILE)
|
||||
SafeReader.readFile stateFile, 64, 'ascii', (err, oldState) ->
|
||||
return callback(err) if err?
|
||||
logger.log state:state, oldState: oldState, basePath:basePath, stateMatches: !(state isnt oldState), "checking sync state"
|
||||
if state isnt oldState
|
||||
return callback new Errors.FilesOutOfSyncError("invalid state for incremental update")
|
||||
else
|
||||
|
|
|
@ -16,6 +16,7 @@ module.exports = ResourceWriter =
|
|||
|
||||
syncResourcesToDisk: (request, basePath, callback = (error, resourceList) ->) ->
|
||||
if request.syncType is "incremental"
|
||||
logger.log project_id: request.project_id, user_id: request.user_id, "incremental sync"
|
||||
ResourceStateManager.checkProjectStateHashMatches request.syncState, basePath, (error) ->
|
||||
return callback(error) if error?
|
||||
ResourceListManager.loadResourceList basePath, (error, resourceList) ->
|
||||
|
@ -26,6 +27,7 @@ module.exports = ResourceWriter =
|
|||
return callback(error) if error?
|
||||
callback(null, resourceList)
|
||||
else
|
||||
logger.log project_id: request.project_id, user_id: request.user_id, "full sync"
|
||||
@saveAllResourcesToDisk request.project_id, request.resources, basePath, (error) ->
|
||||
return callback(error) if error?
|
||||
ResourceStateManager.saveProjectStateHash request.syncState, basePath, (error) ->
|
||||
|
|
Loading…
Add table
Reference in a new issue