mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-11-30 02:47:35 +08:00
refine 'config reload' error message
This commit is contained in:
parent
125baabc4c
commit
600144c937
@ -1259,8 +1259,13 @@ void admin_set_config(network_mysqld_con* con, char* key, char* value)
|
||||
static void admin_reload_settings(network_mysqld_con* con)
|
||||
{
|
||||
GList *options = admin_get_all_options(con->srv);
|
||||
|
||||
if (!chassis_config_reload_options(con->srv->config_manager)) {
|
||||
gint ret = chassis_config_reload_options(con->srv->config_manager);
|
||||
if (ret == -1) {
|
||||
network_mysqld_con_send_error(con->client,
|
||||
C("Can't connect to remote or can't get config"));
|
||||
return;
|
||||
}
|
||||
if (ret == -2) {
|
||||
network_mysqld_con_send_error(con->client,
|
||||
C("Can't load options, only support remote config"));
|
||||
return;
|
||||
|
@ -320,14 +320,18 @@ chassis_config_load_options_mysql(chassis_config_t *conf)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean chassis_config_reload_options(chassis_config_t *conf)
|
||||
gint chassis_config_reload_options(chassis_config_t *conf)
|
||||
{
|
||||
switch (conf->type) {
|
||||
case CHASSIS_CONF_MYSQL:
|
||||
return chassis_config_load_options_mysql(conf);
|
||||
if(chassis_config_load_options_mysql(conf)) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
default:
|
||||
/* TODO g_critical(G_STRLOC " not implemented"); */
|
||||
return FALSE;
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ chassis_config_t *chassis_config_from_local_dir(char *dir, char *conf_file);
|
||||
|
||||
void chassis_config_free(chassis_config_t *);
|
||||
|
||||
gboolean chassis_config_reload_options(chassis_config_t *conf);
|
||||
gint chassis_config_reload_options(chassis_config_t *conf);
|
||||
|
||||
GHashTable *chassis_config_get_options(chassis_config_t *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user