mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #5861 from overleaf/bg-log-missing-pathnames
log missing pathnames in document-updater GitOrigin-RevId: bf3bdee5ded278710aa0b80193b2cf884029f07b
This commit is contained in:
parent
587cd33d82
commit
033b9bd982
2 changed files with 34 additions and 0 deletions
|
@ -83,6 +83,16 @@ function getDoc(projectId, docId, options = {}, _callback) {
|
||||||
if (body.pathname == null) {
|
if (body.pathname == null) {
|
||||||
return callback(new Error('web API response had no valid doc pathname'))
|
return callback(new Error('web API response had no valid doc pathname'))
|
||||||
}
|
}
|
||||||
|
if (!body.pathname) {
|
||||||
|
logger.warn(
|
||||||
|
{ projectId, docId },
|
||||||
|
'missing pathname in PersistenceManager getDoc'
|
||||||
|
)
|
||||||
|
Metrics.inc('pathname', 1, {
|
||||||
|
path: 'PersistenceManager.getDoc',
|
||||||
|
status: body.pathname === '' ? 'zero-length' : 'undefined',
|
||||||
|
})
|
||||||
|
}
|
||||||
callback(
|
callback(
|
||||||
null,
|
null,
|
||||||
body.lines,
|
body.lines,
|
||||||
|
|
|
@ -98,6 +98,13 @@ module.exports = RedisManager = {
|
||||||
rclient.sadd(keys.docsInProject({ project_id }), doc_id, error => {
|
rclient.sadd(keys.docsInProject({ project_id }), doc_id, error => {
|
||||||
if (error) return callback(error)
|
if (error) return callback(error)
|
||||||
|
|
||||||
|
if (!pathname) {
|
||||||
|
metrics.inc('pathname', 1, {
|
||||||
|
path: 'RedisManager.setDoc',
|
||||||
|
status: pathname === '' ? 'zero-length' : 'undefined',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
rclient.mset(
|
rclient.mset(
|
||||||
{
|
{
|
||||||
[keys.docLines({ doc_id })]: docLines,
|
[keys.docLines({ doc_id })]: docLines,
|
||||||
|
@ -267,6 +274,13 @@ module.exports = RedisManager = {
|
||||||
projectHistoryId = parseInt(projectHistoryId)
|
projectHistoryId = parseInt(projectHistoryId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pathname) {
|
||||||
|
metrics.inc('pathname', 1, {
|
||||||
|
path: 'RedisManager.getDoc',
|
||||||
|
status: pathname === '' ? 'zero-length' : 'undefined',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
callback(
|
callback(
|
||||||
null,
|
null,
|
||||||
docLines,
|
docLines,
|
||||||
|
@ -594,6 +608,16 @@ module.exports = RedisManager = {
|
||||||
return callback(error)
|
return callback(error)
|
||||||
}
|
}
|
||||||
if (lines != null && version != null) {
|
if (lines != null && version != null) {
|
||||||
|
if (!update.newPathname) {
|
||||||
|
logger.warn(
|
||||||
|
{ project_id, doc_id, update },
|
||||||
|
'missing pathname in RedisManager.renameDoc'
|
||||||
|
)
|
||||||
|
metrics.inc('pathname', 1, {
|
||||||
|
path: 'RedisManager.renameDoc',
|
||||||
|
status: update.newPathname === '' ? 'zero-length' : 'undefined',
|
||||||
|
})
|
||||||
|
}
|
||||||
return rclient.set(
|
return rclient.set(
|
||||||
keys.pathname({ doc_id }),
|
keys.pathname({ doc_id }),
|
||||||
update.newPathname,
|
update.newPathname,
|
||||||
|
|
Loading…
Reference in a new issue