mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-27 18:56:30 +00:00
Report banned addresses as disabled (#111)
This commit is contained in:
committed by
GitHub
parent
499612dd76
commit
b828e62408
@@ -252,10 +252,10 @@ where
|
|||||||
let pool_config = pool.settings.clone();
|
let pool_config = pool.settings.clone();
|
||||||
for shard in 0..pool.shards() {
|
for shard in 0..pool.shards() {
|
||||||
let database_name = &pool_config.shards[&shard.to_string()].database;
|
let database_name = &pool_config.shards[&shard.to_string()].database;
|
||||||
|
|
||||||
for server in 0..pool.servers(shard) {
|
for server in 0..pool.servers(shard) {
|
||||||
let address = pool.address(shard, server);
|
let address = pool.address(shard, server);
|
||||||
let pool_state = pool.pool_state(shard, server);
|
let pool_state = pool.pool_state(shard, server);
|
||||||
|
let banned = pool.is_banned(address, shard, Some(address.role));
|
||||||
|
|
||||||
res.put(data_row(&vec![
|
res.put(data_row(&vec![
|
||||||
address.name(), // name
|
address.name(), // name
|
||||||
@@ -270,7 +270,11 @@ where
|
|||||||
pool_config.user.pool_size.to_string(), // max_connections
|
pool_config.user.pool_size.to_string(), // max_connections
|
||||||
pool_state.connections.to_string(), // current_connections
|
pool_state.connections.to_string(), // current_connections
|
||||||
"0".to_string(), // paused
|
"0".to_string(), // paused
|
||||||
"0".to_string(), // disabled
|
match banned {
|
||||||
|
// disabled
|
||||||
|
true => "1".to_string(),
|
||||||
|
false => "0".to_string(),
|
||||||
|
},
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user