]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: mailbox_list_index_very_dirty_syncs disabled for force-resync
authorSergey Kitov <sergey.kitov@open-xchange.com>
Mon, 7 Aug 2017 13:03:46 +0000 (16:03 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 16 Aug 2017 09:20:22 +0000 (12:20 +0300)
prerun of cmd force-resync sets mailbox_list_index_very_dirty_syncs to
no for mail_storage_service_user befor mail_user is allocated.

src/doveadm/doveadm-mail.c

index a6944738e5cff97dd640e4321bb56c8d615f2370..15046d458edaa89de53f5adc8f260e0cf4b8f8c7 100644 (file)
@@ -302,6 +302,18 @@ static int cmd_force_resync_box(struct doveadm_mail_cmd_context *ctx,
        return ret;
 }
 
+static int cmd_force_resync_prerun(struct doveadm_mail_cmd_context *ctx ATTR_UNUSED,
+                                  struct mail_storage_service_user *service_user,
+                                  const char **error_r)
+{
+       if (mail_storage_service_user_set_setting(service_user,
+                                                 "mailbox_list_index_very_dirty_syncs",
+                                                 "no",
+                                                 error_r) <= 0)
+               i_unreached();
+       return 0;
+}
+
 static int cmd_force_resync_run(struct doveadm_mail_cmd_context *ctx,
                                struct mail_user *user)
 {
@@ -347,6 +359,7 @@ static struct doveadm_mail_cmd_context *cmd_force_resync_alloc(void)
        ctx = doveadm_mail_cmd_alloc(struct doveadm_mail_cmd_context);
        ctx->v.init = cmd_force_resync_init;
        ctx->v.run = cmd_force_resync_run;
+       ctx->v.prerun = cmd_force_resync_prerun;
        return ctx;
 }