]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: maildir_sync_notify() - Retrofit notify_progress()
authorMarco Bettini <marco.bettini@open-xchange.com>
Thu, 9 Feb 2023 10:01:50 +0000 (10:01 +0000)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 22 May 2023 09:21:43 +0000 (09:21 +0000)
Also change the timeout from MAIL_STORAGE_STAYALIVE_SECS to
MAIL_STORAGE_NOTIFY_INTERVAL_SECS

src/lib-storage/index/maildir/maildir-sync.c
src/lib-storage/mail-storage.h

index 69be170c69af6db6fc4eda148e356d9abeaebb61..075429f06acba98e7a135d451d4e48cd2eb40bee 100644 (file)
@@ -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;
        }
 }
index 0c17ef95fadfbf962cde06a99da0368855ad2c6c..71f8679ce729238718f9253942885010063ddd8b 100644 (file)
@@ -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