mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 22:31:48 -05:00
improved migration script to delete docs
This commit is contained in:
parent
dae47efa1c
commit
ce10ceb2d9
1 changed files with 6 additions and 10 deletions
|
@ -8,22 +8,19 @@ _ = require("lodash")
|
||||||
async = require("async")
|
async = require("async")
|
||||||
exec = require("child_process").exec
|
exec = require("child_process").exec
|
||||||
|
|
||||||
finished_projects_path = "/home/sharelatex/finished-projects"
|
finished_projects_path = "./finished-projects"
|
||||||
all_projects_path = "/home/sharelatex/all-projects"
|
all_projects_path = "./all-projects"
|
||||||
unmigrated_docs_path = "/home/sharelatex/unmigrated"
|
unmigrated_docs_path = "./unmigrated"
|
||||||
|
|
||||||
processedFiles = fs.readFileSync finished_projects_path
|
|
||||||
|
|
||||||
printProgress = ->
|
printProgress = ->
|
||||||
exec "wc #{finished_projects_path}", (error, results) ->
|
exec "wc #{finished_projects_path}", (error, results) ->
|
||||||
setTimeout printProgress, 1000 * 30
|
setTimeout printProgress, 1000 * 30
|
||||||
|
|
||||||
checkIfFileHasBeenProccessed = (project_id, callback)->
|
checkIfFileHasBeenProccessed = (project_id, callback)->
|
||||||
hasBeenProcessed = _.include processedFiles, project
|
exec "grep #{project_id} #{finished_projects_path}", (error, results) ->
|
||||||
callback null, hasBeenProcessed
|
hasBeenProcessed = _.include(results, project_id)
|
||||||
# exec "grep #{project_id} #{finished_projects_path}", (error, results) ->
|
callback(error, hasBeenProcessed)
|
||||||
# hasBeenProcessed = _.include(results, project_id)
|
|
||||||
# callback(error, hasBeenProcessed)
|
|
||||||
|
|
||||||
loadProjectIds = (callback)->
|
loadProjectIds = (callback)->
|
||||||
console.log "loading project ids from #{all_projects_path}"
|
console.log "loading project ids from #{all_projects_path}"
|
||||||
|
@ -191,4 +188,3 @@ exports.migrate = (client, done = ->)->
|
||||||
exports.rollback = (next)->
|
exports.rollback = (next)->
|
||||||
next()
|
next()
|
||||||
|
|
||||||
exports.migrate()
|
|
||||||
|
|
Loading…
Reference in a new issue