From bc42539fc452edd869c95d8f130684da348c6db8 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Mon, 29 Jan 2018 10:02:38 -0700 Subject: [PATCH] cleanup --- bin/cli-users | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/cli-users b/bin/cli-users index 6e901f529..cb87445c5 100755 --- a/bin/cli-users +++ b/bin/cli-users @@ -28,7 +28,6 @@ const CommentModel = require('../models/comment'); const ActionModel = require('../models/action'); const USER_ROLES = require('../models/enum/user_roles'); const mongoose = require('../services/mongoose'); -const databaseVerifications = require('./verifications/database'); // Register the shutdown criteria. util.onshutdown([() => mongoose.disconnect()]); @@ -65,6 +64,8 @@ async function deleteUser(userID) { console.warn("Removing user's actions"); + // FIXME: fix the counts. + // Remove all the user's actions. await ActionModel.where({ user_id: user.id }) .setOptions({ multi: true }) @@ -77,13 +78,6 @@ async function deleteUser(userID) { .setOptions({ multi: true }) .remove(); - console.warn('Updating the database indexes'); - - // Update the counts that might have changed. - for (const verification of databaseVerifications) { - await verification({ fix: true, limit: Infinity, batch: 1000 }); - } - console.warn('Removing the user'); // Remove the user.