From 97cbe4b6d371984fee323b6d10f2b3b74a97f844 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 2 Apr 2020 23:52:46 +0300 Subject: [PATCH] lib-index: Add mail_cache_corrupted event --- src/lib-index/mail-cache.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index f409b01716..4de6aea9dd 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -44,10 +44,13 @@ void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) va_start(va, fmt); T_BEGIN { - mail_index_set_error(cache->index, - "Corrupted index cache file %s: %s", - cache->filepath, - t_strdup_vprintf(fmt, va)); + const char *reason = t_strdup_vprintf(fmt, va); + const char *errstr = t_strdup_printf( + "Deleting corrupted file: %s", reason); + e_error(event_create_passthrough(cache->event)-> + set_name("mail_cache_corrupted")-> + add_str("reason", reason)->event(), "%s", errstr); + mail_index_set_error_nolog(cache->index, errstr); } T_END; va_end(va); } -- 2.47.3