1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-01 11:09:30 +02:00

Allow /metrics on default port; reduce memory if not enabled

This commit is contained in:
binwiederhier 2023-03-15 22:34:06 -04:00
parent bb3fe4f830
commit 358b344916
9 changed files with 184 additions and 125 deletions

View file

@ -165,7 +165,7 @@ func (s *smtpSession) Data(r io.Reader) error {
s.backend.mu.Lock()
s.backend.success++
s.backend.mu.Unlock()
metrics.emailsReceivedSuccess.Inc()
minc(metricEmailsReceivedSuccess)
return nil
})
}
@ -218,7 +218,7 @@ func (s *smtpSession) withFailCount(fn func() error) error {
// We do not want to spam the log with WARN messages.
logem(s.conn).Err(err).Debug("Incoming mail error")
s.backend.failure++
metrics.emailsReceivedFailure.Inc()
minc(metricEmailsReceivedFailure)
}
return err
}