From: Marco Bettini Date: Thu, 9 Feb 2023 10:01:50 +0000 (+0000) Subject: lib-storage: maildir_sync_notify() - Retrofit notify_progress() X-Git-Tag: 2.4.0~2741 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72d14d05d4807f864674610d222ce7129e80192e;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: maildir_sync_notify() - Retrofit notify_progress() Also change the timeout from MAIL_STORAGE_STAYALIVE_SECS to MAIL_STORAGE_NOTIFY_INTERVAL_SECS --- diff --git a/src/lib-storage/index/maildir/maildir-sync.c b/src/lib-storage/index/maildir/maildir-sync.c index 69be170c69..075429f06a 100644 --- a/src/lib-storage/index/maildir/maildir-sync.c +++ b/src/lib-storage/index/maildir/maildir-sync.c @@ -249,14 +249,14 @@ void maildir_sync_notify(struct maildir_sync_context *ctx) (void)maildir_uidlist_lock_touch(ctx->mbox->uidlist); ctx->last_touch = now; } - if (now - ctx->last_notify > MAIL_STORAGE_STAYALIVE_SECS) { + if (now - ctx->last_notify > MAIL_STORAGE_NOTIFY_INTERVAL_SECS) { struct mailbox *box = &ctx->mbox->box; - if (box->storage->callbacks.notify_ok != NULL) { - box->storage->callbacks. - notify_ok(box, "Hang in there..", - box->storage->callback_context); - } + if (box->storage->callbacks.notify_progress != NULL) T_BEGIN { + struct mail_storage_progress_details dtl = {}; + box->storage->callbacks.notify_progress( + box, &dtl, box->storage->callback_context); + } T_END; ctx->last_notify = now; } } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 0c17ef95fa..71f8679ce7 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -14,7 +14,6 @@ struct message_size; #include "mailbox-attribute.h" /* If some operation is taking long, call notify_ok every n seconds. */ -#define MAIL_STORAGE_STAYALIVE_SECS 15 #define MAIL_STORAGE_NOTIFY_INTERVAL_SECS 10 /* Expunge transactions are to be commited after