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); } /**