]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: "doveadm director move" to same host now refreshes user's timeout
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 23 Jan 2017 16:02:05 +0000 (18:02 +0200)
committerGitLab <gitlab@git.dovecot.net>
Tue, 24 Jan 2017 12:36:06 +0000 (14:36 +0200)
This allows keeping user constantly in the same backend by just periodically
moving the user there.

src/director/doveadm-connection.c

index b99ad185febb9e046460c42627492fd4fd68fb79..a30fa6a33f6897dba47d81672e57156014302a8c 100644 (file)
@@ -676,6 +676,10 @@ doveadm_cmd_user_move(struct doveadm_connection *conn, const char *const *args)
        if (user == NULL || user->host != host) {
                director_move_user(conn->dir, conn->dir->self_host, NULL,
                                   username_hash, host);
+       } else {
+               /* already the correct host. reset the user's timeout. */
+               user_directory_refresh(host->tag->users, user);
+               director_update_user(conn->dir, conn->dir->self_host, user);
        }
        o_stream_nsend(conn->output, "OK\n", 3);
        return 1;