From b1c14a8825e9ed522e2883ea96cddcd5680da462 Mon Sep 17 00:00:00 2001 From: Marcelo Altmann Date: Tue, 29 Oct 2024 15:45:06 -0700 Subject: [PATCH] Change host status Change host status before updating the hostgroup, so it reflects the correct status. --- src/proxysql.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proxysql.rs b/src/proxysql.rs index 0a830ee..b979931 100644 --- a/src/proxysql.rs +++ b/src/proxysql.rs @@ -198,12 +198,12 @@ impl ProxySQL { ) .as_str(), ); + host.change_status(status); let _ = self.conn.query_drop(format!( "UPDATE mysql_servers SET status = '{}' {}", host.get_status(), where_clause )); - host.change_status(status); let _ = self.conn.query_drop("LOAD MYSQL SERVERS TO RUNTIME"); let _ = self.conn.query_drop("SAVE MYSQL SERVERS TO DISK"); }