From 2ee81d6c50323f6dd83216311236a56f84308d7b Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 16 Apr 2015 13:45:16 +0100 Subject: [PATCH] improved migration script to delete docs --- .../2_doc_lines_delete_from_project.coffee | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/server-ce/migrations/2_doc_lines_delete_from_project.coffee b/server-ce/migrations/2_doc_lines_delete_from_project.coffee index 49e7eb0918..bc413d8134 100644 --- a/server-ce/migrations/2_doc_lines_delete_from_project.coffee +++ b/server-ce/migrations/2_doc_lines_delete_from_project.coffee @@ -8,22 +8,19 @@ _ = require("lodash") async = require("async") exec = require("child_process").exec -finished_projects_path = "/home/sharelatex/finished-projects" -all_projects_path = "/home/sharelatex/all-projects" -unmigrated_docs_path = "/home/sharelatex/unmigrated" +finished_projects_path = "./finished-projects" +all_projects_path = "./all-projects" +unmigrated_docs_path = "./unmigrated" -processedFiles = fs.readFileSync finished_projects_path printProgress = -> exec "wc #{finished_projects_path}", (error, results) -> setTimeout printProgress, 1000 * 30 checkIfFileHasBeenProccessed = (project_id, callback)-> - hasBeenProcessed = _.include processedFiles, project - callback null, hasBeenProcessed - # exec "grep #{project_id} #{finished_projects_path}", (error, results) -> - # hasBeenProcessed = _.include(results, project_id) - # callback(error, hasBeenProcessed) + exec "grep #{project_id} #{finished_projects_path}", (error, results) -> + hasBeenProcessed = _.include(results, project_id) + callback(error, hasBeenProcessed) loadProjectIds = (callback)-> console.log "loading project ids from #{all_projects_path}" @@ -191,4 +188,3 @@ exports.migrate = (client, done = ->)-> exports.rollback = (next)-> next() -exports.migrate()