Skip to content

Commit d2277a8

Browse files
Merge pull request #26 from readysettech/only_online_hosts
Filter out hosts that are OFFLINE_SOFT or OFFLINE_HARD
2 parents b1c14a8 + a80e710 commit d2277a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/proxysql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl ProxySQL {
3939
.expect("Failed to create ProxySQL connection");
4040

4141
let query = format!(
42-
"SELECT hostname, port, status, comment FROM mysql_servers WHERE hostgroup_id = {}",
42+
"SELECT hostname, port, status, comment FROM mysql_servers WHERE hostgroup_id = {} AND status IN ('ONLINE', 'SHUNNED')",
4343
config.readyset_hostgroup
4444
);
4545
let results: Vec<(String, u16, String, String)> = conn.query(query).unwrap();

0 commit comments

Comments
 (0)