mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-01 13:13:53 +08:00
auto expire journal entries after 6 hours
This commit is contained in:
parent
1ba5ba0c65
commit
fd6e7983e3
2 changed files with 15 additions and 0 deletions
|
@ -98,6 +98,10 @@ class ImapNotifier extends EventEmitter {
|
|||
return callback(null, false);
|
||||
}
|
||||
|
||||
entries.forEach(entry => {
|
||||
entry.created = new Date();
|
||||
});
|
||||
|
||||
this.database.collection('mailboxes').findOneAndUpdate({
|
||||
username,
|
||||
path
|
||||
|
|
11
indexes.js
11
indexes.js
|
@ -82,3 +82,14 @@ db.messages.createIndex({
|
|||
db['attachments.files'].createIndex({
|
||||
'metadata.messages': 1
|
||||
});
|
||||
|
||||
db.journal.createIndex({
|
||||
mailbox: 1,
|
||||
modseq: 1
|
||||
});
|
||||
|
||||
db.journal.createIndex({
|
||||
created: 1
|
||||
}, {
|
||||
expireAfterSeconds: 21600
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue