Cleanup purge old keys

This commit is contained in:
Tankred Hase 2017-08-25 16:11:35 +08:00 committed by GitHub
parent b738e1bc5c
commit 77fc0fd195

View File

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