From: Timo Sirainen Date: Tue, 9 Aug 2011 13:41:29 +0000 (+0300) Subject: fts: Log how many messages were indexed. X-Git-Tag: 2.1.alpha1~153 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73bc0de052ae7a08c00bd484b1fc6c2c548d42ee;p=thirdparty%2Fdovecot%2Fcore.git fts: Log how many messages were indexed. --- diff --git a/src/plugins/fts/fts-build-private.h b/src/plugins/fts/fts-build-private.h index e035ec7770..29d3f27a85 100644 --- a/src/plugins/fts/fts-build-private.h +++ b/src/plugins/fts/fts-build-private.h @@ -29,6 +29,8 @@ struct fts_storage_build_context { char *content_type, *content_disposition; struct fts_parser *body_parser; + unsigned int indexed_msg_count; + unsigned int binary_mime_parts:1; unsigned int dtcase:1; unsigned int notified:1; diff --git a/src/plugins/fts/fts-build.c b/src/plugins/fts/fts-build.c index e3bcebc7ca..d85580d4ba 100644 --- a/src/plugins/fts/fts-build.c +++ b/src/plugins/fts/fts-build.c @@ -104,7 +104,6 @@ static void fts_build_mail_header(struct fts_storage_build_context *ctx, if (!message_header_is_address(hdr->name)) { /* regular unstructured header */ - // FIXME: get rid of potential NULs fts_build_unstructured_header(ctx, hdr); } else T_BEGIN { /* message address. normalize it to give better @@ -285,6 +284,8 @@ int fts_build_mail(struct fts_storage_build_context *ctx, struct mail *mail) /* make sure body is added even when it doesn't exist */ ret = fts_backend_update_build_more(ctx->update_ctx, NULL, 0); } + if (ret == 0) + ctx->indexed_msg_count++; if (message_parser_deinit(&parser, &parts) < 0) mail_set_cache_corrupted(mail, MAIL_FETCH_MESSAGE_PARTS); message_decoder_deinit(&decoder); @@ -374,6 +375,10 @@ int fts_build_deinit(struct fts_storage_build_context **_ctx) if (ctx->v.deinit(ctx) < 0) ret = -1; + if (ctx->indexed_msg_count > 0) { + i_info("Indexed %u messages in %s", ctx->indexed_msg_count, + mailbox_get_vname(ctx->box)); + } if (ctx->update_ctx != NULL) { if (fts_backend_update_deinit(&ctx->update_ctx) < 0) ret = -1;