add logging to tell us how long since a project that is being opened was last updated

This commit is contained in:
Henry Oswald 2015-07-22 10:38:48 +01:00
parent c12213b46b
commit 417fd4f5f5

View file

@ -193,11 +193,13 @@ module.exports = ProjectController =
if err? if err?
logger.err err:err, "error getting details for project page" logger.err err:err, "error getting details for project page"
return next err return next err
logger.log project_id:project_id, "got db results for loading editor"
project = results.project project = results.project
user = results.user user = results.user
subscription = results.subscription subscription = results.subscription
daysSinceLastUpdated = (new Date() - project.lastUpdated) /86400000
logger.log project_id:project_id, daysSinceLastUpdated:daysSinceLastUpdated, "got db results for loading editor"
SecurityManager.userCanAccessProject user, project, (canAccess, privilegeLevel)-> SecurityManager.userCanAccessProject user, project, (canAccess, privilegeLevel)->
if !canAccess if !canAccess
return res.sendStatus 401 return res.sendStatus 401