]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add reason_code=mailbox:search
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 17 Mar 2021 13:15:00 +0000 (15:15 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 29 Sep 2021 10:09:58 +0000 (10:09 +0000)
src/lib-storage/index/index-search.c

index 929aa4b3fd3ca53d20a5b42de726835bfd238001..71dfc70152934a60e440a398e1527436bbcdc60d 100644 (file)
@@ -1402,12 +1402,16 @@ static int search_match_once(struct index_search_context *ctx)
 {
        int ret;
 
+       /* Use search as the reason only while specifically matching the search
+          parameters, not while prefetching wanted_fields. */
+       struct event_reason *reason = event_reason_begin("mailbox:search");
        ret = mail_search_args_foreach(ctx->mail_ctx.args->args,
                                       search_cached_arg, ctx);
        if (ret < 0)
                ret = search_arg_match_text(ctx->mail_ctx.args->args, ctx);
        if (ret < 0)
                ret = index_search_mime_arg_match(ctx->mail_ctx.args->args, ctx);
+       event_reason_end(&reason);
        return ret;
 }