mirror of
https://github.com/haiwen/ccnet-server.git
synced 2025-09-05 06:40:13 +00:00
Fix a bug in setting mysql max connections
This commit is contained in:
@@ -170,9 +170,11 @@ static int init_mysql_database (CcnetSession *session)
|
|||||||
|
|
||||||
max_connections = g_key_file_get_integer (session->keyf,
|
max_connections = g_key_file_get_integer (session->keyf,
|
||||||
"Database", "MAX_CONNECTIONS",
|
"Database", "MAX_CONNECTIONS",
|
||||||
NULL);
|
&error);
|
||||||
if (max_connections <= 0)
|
if (error || max_connections < 0) {
|
||||||
max_connections = DEFAULT_MAX_CONNECTIONS;
|
max_connections = DEFAULT_MAX_CONNECTIONS;
|
||||||
|
g_clear_error (&error);
|
||||||
|
}
|
||||||
|
|
||||||
session->db = ccnet_db_new_mysql (host, port, user, passwd, db, unix_socket, use_ssl, charset, max_connections);
|
session->db = ccnet_db_new_mysql (host, port, user, passwd, db, unix_socket, use_ssl, charset, max_connections);
|
||||||
if (!session->db) {
|
if (!session->db) {
|
||||||
|
Reference in New Issue
Block a user