From 00d6a41e46e4c4948b0d5b4cf21433150a57c067 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 27 Dec 2016 18:33:38 +0100 Subject: Add script to migrate from mongodb to postgresql Usage: NODE_ENV=production ./scripts/mongo-to-postgre.js --mongo-database peertube-prod --- scripts/danger/clean/cleaner.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/danger/clean/cleaner.js') diff --git a/scripts/danger/clean/cleaner.js b/scripts/danger/clean/cleaner.js index d1e218145..1a1e3dee7 100644 --- a/scripts/danger/clean/cleaner.js +++ b/scripts/danger/clean/cleaner.js @@ -1,3 +1,4 @@ +const eachSeries = require('async/eachSeries') const rimraf = require('rimraf') const constants = require('../../../server/initializers/constants') @@ -10,14 +11,15 @@ db.init(true, function () { console.info('Tables of %s deleted.', db.sequelize.config.database) const STORAGE = constants.CONFIG.STORAGE - Object.keys(STORAGE).forEach(function (storage) { + eachSeries(Object.keys(STORAGE), function (storage, callbackEach) { const storageDir = STORAGE[storage] rimraf(storageDir, function (err) { - if (err) throw err - - console.info('Deleting %s.', storageDir) + console.info('%s deleted.', storageDir) + return callbackEach(err) }) + }, function () { + process.exit(0) }) }) }) -- cgit v1.2.3