mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
added logging to help debug slow project list page loading
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)->
|
||||
|
||||
Reference in New Issue
Block a user