changeset 17725:bd381e882485

director: Log a warning when using "director host flush" for all hosts.
author Timo Sirainen <tss@iki.fi>
date Mon, 18 Aug 2014 22:39:56 +0200
parents 3d30ae287699
children 2ca346d91310
files src/director/doveadm-connection.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/director/doveadm-connection.c	Mon Aug 18 10:43:59 2014 +0200
+++ b/src/director/doveadm-connection.c	Mon Aug 18 22:39:56 2014 +0200
@@ -238,11 +238,16 @@
 doveadm_cmd_host_flush_all(struct doveadm_connection *conn)
 {
 	struct mail_host *const *hostp;
+	unsigned int total_user_count = 0;
 
 	array_foreach(mail_hosts_get(conn->dir->mail_hosts), hostp) {
+		total_user_count += (*hostp)->user_count;
 		director_flush_host(conn->dir, conn->dir->self_host,
 				    NULL, *hostp);
 	}
+	i_warning("Flushed all backend hosts with %u users. This is an unsafe "
+		  "operation and may cause the same users to end up in multiple backends.",
+		  total_user_count);
 	o_stream_nsend(conn->output, "OK\n", 3);
 }