Cleanup purge old keys
This commit is contained in:
parent
b738e1bc5c
commit
77fc0fd195
@ -91,11 +91,10 @@ class PublicKey {
|
|||||||
const xDaysAgo = new Date();
|
const xDaysAgo = new Date();
|
||||||
xDaysAgo.setDate(xDaysAgo.getDate() - config.publicKey.purgeTimeInDays);
|
xDaysAgo.setDate(xDaysAgo.getDate() - config.publicKey.purgeTimeInDays);
|
||||||
// remove unverified keys older than x days (or no 'uploaded' attribute)
|
// remove unverified keys older than x days (or no 'uploaded' attribute)
|
||||||
const query = {
|
return this._mongo.remove({
|
||||||
'userIds.verified': {$ne: true},
|
'userIds.verified': {$ne: true},
|
||||||
uploaded: {$lt: xDaysAgo}
|
uploaded: {$lt: xDaysAgo}
|
||||||
};
|
}, DB_TYPE);
|
||||||
return this._mongo.remove(query, DB_TYPE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user