Mercurial > dovecot > core-2.2
changeset 20716:097b3edfae94
lib-index: limit mail_index error prints to one per ioloop_time
This is to prevent log flooding.
author | Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
---|---|
date | Thu, 08 Sep 2016 19:01:54 +0300 |
parents | b5bf847c215c |
children | 4e90ac53cd05 |
files | src/lib-index/mail-index-private.h src/lib-index/mail-index.c |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-private.h Fri Sep 09 10:38:10 2016 +0300 +++ b/src/lib-index/mail-index-private.h Thu Sep 08 19:01:54 2016 +0300 @@ -215,6 +215,7 @@ ARRAY(union mail_index_module_context *) module_contexts; char *error; + time_t last_error_time; unsigned int nodiskspace:1; unsigned int index_lock_timeout:1;
--- a/src/lib-index/mail-index.c Fri Sep 09 10:38:10 2016 +0300 +++ b/src/lib-index/mail-index.c Thu Sep 08 19:01:54 2016 +0300 @@ -753,7 +753,10 @@ index->error = i_strdup_vprintf(fmt, va); va_end(va); - i_error("%s", index->error); + if (ioloop_time != index->last_error_time) { + index->last_error_time = ioloop_time; + i_error("%s", index->error); + } } }