mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix the doc lines migration.
- The bson module changed at some point, update to new api
This commit is contained in:
parent
458b0d1256
commit
93b8a9b13d
1 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
||||||
Settings = require "settings-sharelatex"
|
Settings = require "settings-sharelatex"
|
||||||
|
bson = require('bson')
|
||||||
|
BSON = new bson()
|
||||||
fs = require("fs")
|
fs = require("fs")
|
||||||
mongojs = require("mongojs")
|
mongojs = require("mongojs")
|
||||||
ObjectId = mongojs.ObjectId
|
ObjectId = mongojs.ObjectId
|
||||||
|
@ -61,7 +63,7 @@ getAllDocs = (project_id, callback = (error, docs) ->) ->
|
||||||
if !project?
|
if !project?
|
||||||
console.log "no such project #{project_id}"
|
console.log "no such project #{project_id}"
|
||||||
return callback()
|
return callback()
|
||||||
size = require("../node_modules/mongojs/node_modules/mongodb/node_modules/bson/").BSONPure.BSON.calculateObjectSize(project)
|
size = BSON.calculateObjectSize(project)
|
||||||
if size > 12000000 #12mb
|
if size > 12000000 #12mb
|
||||||
return markProjectAsToLargeAndFinished project_id, callback
|
return markProjectAsToLargeAndFinished project_id, callback
|
||||||
findAllDocsInProject project, (error, docs) ->
|
findAllDocsInProject project, (error, docs) ->
|
||||||
|
|
Loading…
Reference in a new issue