mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2714 from overleaf/cmg-jpa-call-stack-exceeded
Stop call stack from being exceeding when adding many files GitOrigin-RevId: 1983b0c16cb279c6f173f614d541d16852664e24
This commit is contained in:
parent
61e338fa7d
commit
0586f4d682
2 changed files with 8 additions and 4 deletions
|
@ -43,9 +43,13 @@ module.exports = ProjectRootDocManager = {
|
||||||
ProjectEntityUpdateHandler.isPathValidForRootDoc(path) &&
|
ProjectEntityUpdateHandler.isPathValidForRootDoc(path) &&
|
||||||
DocumentHelper.contentHasDocumentclass(doc.lines)
|
DocumentHelper.contentHasDocumentclass(doc.lines)
|
||||||
) {
|
) {
|
||||||
return cb(doc._id)
|
async.setImmediate(function() {
|
||||||
|
cb(doc._id)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
return cb(null)
|
async.setImmediate(function() {
|
||||||
|
cb(null)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -113,7 +113,7 @@ describe('ProjectRootDocManager', function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('when the root doc is an Rtex file', function() {
|
describe('when the root doc is an Rtex file', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function(done) {
|
||||||
this.docs = {
|
this.docs = {
|
||||||
'/chapter1.tex': {
|
'/chapter1.tex': {
|
||||||
_id: 'doc-id-1',
|
_id: 'doc-id-1',
|
||||||
|
@ -129,7 +129,7 @@ describe('ProjectRootDocManager', function() {
|
||||||
.callsArgWith(1, null, this.docs)
|
.callsArgWith(1, null, this.docs)
|
||||||
return this.ProjectRootDocManager.setRootDocAutomatically(
|
return this.ProjectRootDocManager.setRootDocAutomatically(
|
||||||
this.project_id,
|
this.project_id,
|
||||||
this.callback
|
done
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue