]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: Log how many messages were indexed.
authorTimo Sirainen <tss@iki.fi>
Tue, 9 Aug 2011 13:41:29 +0000 (16:41 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 9 Aug 2011 13:41:29 +0000 (16:41 +0300)
src/plugins/fts/fts-build-private.h
src/plugins/fts/fts-build.c

index e035ec77703300e943f590d19827a0170be0095b..29d3f27a854e164a022c977fc548efd25ed5040a 100644 (file)
@@ -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;
index e3bcebc7ca1dc049ff03ef769b9116341e805c94..d85580d4baaa42ea7c275e5911e5012a291e8061 100644 (file)
@@ -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;