1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-17 18:39:08 +00:00

added logging to help debug slow project list page loading

This commit is contained in:
Henry Oswald 2015-07-22 01:06:23 +01:00
parent 3ecf201eda
commit a786b623a8
2 changed files with 5 additions and 1 deletions
services/web/app/coffee

View file

@ -173,6 +173,7 @@ module.exports = ProjectController =
user_id = 'openUser'
project_id = req.params.Project_id
logger.log project_id:project_id, "loading editor"
async.parallel {
project: (cb)->
@ -190,6 +191,7 @@ module.exports = ProjectController =
if err?
logger.err err:err, "error getting details for project page"
return next err
logger.log project_id:project_id, "got db results for loading editor"
project = results.project
user = results.user
subscription = results.subscription
@ -200,7 +202,7 @@ module.exports = ProjectController =
if subscription? and subscription.freeTrial? and subscription.freeTrial.expiresAt?
allowedFreeTrial = !!subscription.freeTrial.allowed || true
logger.log project_id:project_id, "rendering editor page"
res.render 'project/editor',
title: project.name
priority_title: true

View file

@ -42,6 +42,7 @@ ProjectSchema.statics.getProject = (project_or_id, fields, callback)->
this.findById project_or_id, fields, callback
ProjectSchema.statics.findPopulatedById = (project_id, callback)->
logger.log project_id:project_id, "findPopulatedById"
this.find(_id: project_id )
.populate('collaberator_refs')
.populate('readOnly_refs')
@ -54,6 +55,7 @@ ProjectSchema.statics.findPopulatedById = (project_id, callback)->
logger.err project_id:project_id, "something went wrong looking for project findPopulatedById, no project could be found"
callback "not found"
else
logger.log project_id:project_id, "finished findPopulatedById"
callback(null, projects[0])
ProjectSchema.statics.findAllUsersProjects = (user_id, requiredFields, callback)->