mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #12368 from overleaf/jlm-jpa-switch-to-json-parse-from-bytes
[docstore] potential optimization for parsing a large JSON from buffer GitOrigin-RevId: 1c2fb82eb27e2f5d58f75b99fab5dffc2d9b51d0
This commit is contained in:
parent
ff492d572c
commit
24d2cf426f
1 changed files with 3 additions and 4 deletions
|
@ -136,8 +136,7 @@ async function getDoc(projectId, docId) {
|
|||
})
|
||||
}
|
||||
|
||||
const json = buffer.toString()
|
||||
return _deserializeArchivedDoc(json)
|
||||
return _deserializeArchivedDoc(buffer)
|
||||
}
|
||||
|
||||
// get the doc and unarchive it to mongo
|
||||
|
@ -199,8 +198,8 @@ async function _streamToBuffer(projectId, docId, stream) {
|
|||
})
|
||||
}
|
||||
|
||||
function _deserializeArchivedDoc(json) {
|
||||
const doc = JSON.parse(json)
|
||||
function _deserializeArchivedDoc(buffer) {
|
||||
const doc = JSON.parse(buffer)
|
||||
|
||||
const result = {}
|
||||
if (doc.schema_v === 1 && doc.lines != null) {
|
||||
|
|
Loading…
Reference in a new issue