mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-12-02 11:57:44 +08:00
Fix problems related to save settings
This commit is contained in:
parent
644ce3e252
commit
76c3d08617
@ -68,6 +68,7 @@ typedef struct chassis chassis;
|
|||||||
#define MAX_DIST_TRAN_PREFIX 64
|
#define MAX_DIST_TRAN_PREFIX 64
|
||||||
#define DEFAULT_LIVE_TIME 7200
|
#define DEFAULT_LIVE_TIME 7200
|
||||||
|
|
||||||
|
#define DEFAULT_POOL_SIZE 10
|
||||||
#define MAX_ALLOWED_PACKET_CEIL (1 * GB)
|
#define MAX_ALLOWED_PACKET_CEIL (1 * GB)
|
||||||
#define MAX_ALLOWED_PACKET_DEFAULT (32 * MB)
|
#define MAX_ALLOWED_PACKET_DEFAULT (32 * MB)
|
||||||
#define MAX_ALLOWED_PACKET_FLOOR (1 * KB)
|
#define MAX_ALLOWED_PACKET_FLOOR (1 * KB)
|
||||||
|
@ -454,7 +454,7 @@ show_default_pool_size(gpointer param) {
|
|||||||
return g_strdup_printf("%d", srv->mid_idle_connections);
|
return g_strdup_printf("%d", srv->mid_idle_connections);
|
||||||
}
|
}
|
||||||
if (CAN_SAVE_OPTS_PROPERTY(opt_type)) {
|
if (CAN_SAVE_OPTS_PROPERTY(opt_type)) {
|
||||||
if (srv->mid_idle_connections == 100) {
|
if (srv->mid_idle_connections == DEFAULT_POOL_SIZE) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return g_strdup_printf("%d", srv->mid_idle_connections);
|
return g_strdup_printf("%d", srv->mid_idle_connections);
|
||||||
@ -473,8 +473,8 @@ assign_default_pool_size(const gchar *newval, gpointer param) {
|
|||||||
gint value = 0;
|
gint value = 0;
|
||||||
if (try_get_int_value(newval, &value)) {
|
if (try_get_int_value(newval, &value)) {
|
||||||
if (value >= 0) {
|
if (value >= 0) {
|
||||||
if (value < 10) {
|
if (value < DEFAULT_POOL_SIZE) {
|
||||||
value = 10;
|
value = DEFAULT_POOL_SIZE;
|
||||||
}
|
}
|
||||||
srv->mid_idle_connections = value;
|
srv->mid_idle_connections = value;
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ chassis_frontend_new(void)
|
|||||||
frontend->is_client_compress_support = 0;
|
frontend->is_client_compress_support = 0;
|
||||||
frontend->xa_log_detailed = 0;
|
frontend->xa_log_detailed = 0;
|
||||||
|
|
||||||
frontend->default_pool_size = 10;
|
frontend->default_pool_size = DEFAULT_POOL_SIZE;
|
||||||
frontend->worker_processes = 1;
|
frontend->worker_processes = 1;
|
||||||
frontend->max_resp_len = 10 * 1024 * 1024; /* 10M */
|
frontend->max_resp_len = 10 * 1024 * 1024; /* 10M */
|
||||||
frontend->max_alive_time = DEFAULT_LIVE_TIME;
|
frontend->max_alive_time = DEFAULT_LIVE_TIME;
|
||||||
@ -701,8 +701,8 @@ init_parameters(struct chassis_frontend_t *frontend, chassis *srv)
|
|||||||
|
|
||||||
g_message("set worker processes:%d", srv->worker_processes);
|
g_message("set worker processes:%d", srv->worker_processes);
|
||||||
|
|
||||||
if (frontend->default_pool_size < 10) {
|
if (frontend->default_pool_size < DEFAULT_POOL_SIZE) {
|
||||||
frontend->default_pool_size = 10;
|
frontend->default_pool_size = DEFAULT_POOL_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
srv->mid_idle_connections = frontend->default_pool_size;
|
srv->mid_idle_connections = frontend->default_pool_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user