mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-09-13 08:34:53 +08:00
fix(autsni): Fixed garbage collection for unfinished certificates
This commit is contained in:
parent
7ee5d06520
commit
5bf6c86542
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ const generateKeyPair = promisify(crypto.generateKeyPair);
|
|||
const CERT_RENEW_TTL = 30 * 24 * 3600 * 1000;
|
||||
const CERT_RENEW_DELAY = 24 * 3600 * 1000;
|
||||
// delete uninitialized certificates after 1 day
|
||||
const CERT_GARBAGE_TTL = 24 * 2300 * 1000;
|
||||
const CERT_GARBAGE_TTL = 24 * 3600 * 1000;
|
||||
|
||||
class CertHandler {
|
||||
constructor(options) {
|
||||
|
@ -117,7 +117,7 @@ class CertHandler {
|
|||
let r = await this.database.collection('certs').deleteMany({
|
||||
acme: true,
|
||||
updated: {
|
||||
$lt: new Date(Date.now() + CERT_GARBAGE_TTL)
|
||||
$lt: new Date(Date.now() - CERT_GARBAGE_TTL)
|
||||
},
|
||||
$or: [{ expires: { $exists: false } }, { expires: { $lt: new Date() } }],
|
||||
autogenerated: true
|
||||
|
|
Loading…
Add table
Reference in a new issue