From 9a1374070feabd699040b38cb9144eb31132123a Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 24 Aug 2017 09:47:27 -0600 Subject: [PATCH 1/2] small fixes --- .vscode/settings.json | 8 -------- graph/resolvers/user.js | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 838540390..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "eslint.autoFixOnSave": true, - "editor.tabSize": 2, - "editor.rulers": [ - 80 - ], - "files.trimTrailingWhitespace": true -} diff --git a/graph/resolvers/user.js b/graph/resolvers/user.js index e566a6af0..7c97e3833 100644 --- a/graph/resolvers/user.js +++ b/graph/resolvers/user.js @@ -42,7 +42,7 @@ const User = { return null; }, tokens({id, tokens}, args, {user}) { - if (!user || ((user.id !== id) && !user.can(LIST_OWN_TOKENS))) { + if (!user || ((user.id !== id) && !user.can(LIST_OWN_TOKENS))) { return null; } From 308449a67cc9a088e885cf9aa2b460f697a3be7a Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 24 Aug 2017 10:24:56 -0600 Subject: [PATCH 2/2] added more messaging for cli tool --- bin/verifications/database/comments.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/verifications/database/comments.js b/bin/verifications/database/comments.js index e80e8ced6..f7dd4d397 100644 --- a/bin/verifications/database/comments.js +++ b/bin/verifications/database/comments.js @@ -21,7 +21,7 @@ module.exports = async ({fix, limit, batch}) => { let comments = []; let commentIDs = []; - debug(`Processing ${totalCount} comments...`); + console.log(`Processing ${totalCount} comments in batches of ${limit}...`); // Keep processing documents until there are is none left. while (offset < totalCount) { @@ -166,13 +166,13 @@ module.exports = async ({fix, limit, batch}) => { const OPERATIONS_LENGTH = operations.length; if (limit < Infinity && offset + comments.length < totalCount) { - debug(`Processed ${offset + comments.length}/${totalCount} comments because we reached the update limit of ${limit}.`); - debug(`Fixing ${OPERATIONS_LENGTH} documents.`); + console.log(`Processed ${offset + comments.length}/${totalCount} comments because we reached the update limit of ${limit}.`); } else { - debug(`Processed all ${totalCount} comments.`); - debug(`${OPERATIONS_LENGTH} documents need fixing.`); + console.log(`Processed all ${totalCount} comments.`); } + console.log(`${OPERATIONS_LENGTH} documents need fixing.`); + // If fix was enabled, execute the batch writes. if (OPERATIONS_LENGTH > 0) { if (fix) { @@ -185,7 +185,7 @@ module.exports = async ({fix, limit, batch}) => { debug(`Fixed batch of ${result.modifiedCount} documents.`); } - debug(`Applied all ${OPERATIONS_LENGTH} fixes.`); + console.log(`Applied all ${OPERATIONS_LENGTH} fixes.`); } else { console.warn('Skipping fixing, --fix was not enabled, pass --fix to fix these errors'); }