Skip to content

Commit

Permalink
fix: switch error log to debug to save log storage, added expiry to j…
Browse files Browse the repository at this point in the history
…ournal entries (3h)
  • Loading branch information
titanism committed May 1, 2024
1 parent 8d843f1 commit fab3143
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/models/journals.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ mongoose.Error.messages = require('@ladjs/mongoose-error-messages');

const Journals = new mongoose.Schema(
{
//
// NOTE: `mongoose-common-plugin` will automatically set `timestamps` for us
// <https://github.com/Automattic/mongoose/blob/b2af0fe4a74aa39eaf3088447b4bb8feeab49342/test/timestamps.test.js#L123-L137>
//
created_at: {
type: Date,
// <https://github.com/nodemailer/wildduck/blob/7ee5d06520f7e84ab3b1097d73bf6479f83206ab/indexes.yaml#L560-L566>
expires: '3h',
index: true
},
mailbox: {
type: mongoose.Schema.ObjectId,
ref: Mailboxes,
Expand Down
2 changes: 1 addition & 1 deletion helpers/process-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function processEmail({ email, port = 25, resolver, client }) {
throw new Error('Email status must be queued');
} catch (err) {
// create log
logger.error(err, meta);
logger.debug(err, meta);
return;
}

Expand Down

0 comments on commit fab3143

Please sign in to comment.