From 77fc0fd19577209b657a314783b2677b4f393d44 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Fri, 25 Aug 2017 16:11:35 +0800 Subject: [PATCH] Cleanup purge old keys --- src/service/public-key.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/service/public-key.js b/src/service/public-key.js index f4098c7..5c61eaf 100644 --- a/src/service/public-key.js +++ b/src/service/public-key.js @@ -91,11 +91,10 @@ class PublicKey { const xDaysAgo = new Date(); xDaysAgo.setDate(xDaysAgo.getDate() - config.publicKey.purgeTimeInDays); // remove unverified keys older than x days (or no 'uploaded' attribute) - const query = { + return this._mongo.remove({ 'userIds.verified': {$ne: true}, uploaded: {$lt: xDaysAgo} - }; - return this._mongo.remove(query, DB_TYPE); + }, DB_TYPE); } /**