Mercurial > dovecot > core-2.2
changeset 22413:633ca13ae99c
indexer-worker: Log first and last UID of which mails were indexed
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sun, 18 Jun 2017 12:18:31 +0300 |
parents | 50a22a23193a |
children | 7ee97c9d9b56 |
files | src/indexer/master-connection.c |
diffstat | 1 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/indexer/master-connection.c Sun Jun 18 13:04:43 2017 +0300 +++ b/src/indexer/master-connection.c Sun Jun 18 12:18:31 2017 +0300 @@ -62,7 +62,7 @@ struct mail_search_context *ctx; struct mail *mail; struct mailbox_metadata metadata; - uint32_t seq; + uint32_t seq, first_uid = 0, last_uid = 0; char percentage_str[2+1+1]; unsigned int counter = 0, max, percentage, percentage_sent = 0; int ret = 0; @@ -93,6 +93,10 @@ max = status.messages + 1 - seq; while (mailbox_search_next(ctx, &mail)) { + if (first_uid == 0) + first_uid = mail->uid; + last_uid = mail->uid; + mail_precache(mail); if (++counter % 100 == 0) { percentage = counter*100 / max; @@ -115,16 +119,18 @@ mailbox_get_last_internal_error(box, NULL)); ret = -1; } + const char *uids = first_uid == 0 ? "" : + t_strdup_printf(" (UIDs %u..%u)", first_uid, last_uid); if (mailbox_transaction_commit(&trans) < 0) { i_error("Mailbox %s: Transaction commit failed: %s" - " (attempted to index %u messages)", + " (attempted to index %u messages%s)", mailbox_get_vname(box), mailbox_get_last_internal_error(box, NULL), - counter); + counter, uids); ret = -1; } else { - i_info("Indexed %u messages in %s", - counter, mailbox_get_vname(box)); + i_info("Indexed %u messages in %s%s", + counter, mailbox_get_vname(box), uids); } return ret; }