1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-09-02 13:25:03 +00:00

Fix a bug in setting mysql max connections

This commit is contained in:
cuihaikuo
2017-08-04 15:38:12 +08:00
parent c58c6f31ae
commit f770efc9cd

View File

@@ -170,9 +170,11 @@ static int init_mysql_database (CcnetSession *session)
max_connections = g_key_file_get_integer (session->keyf,
"Database", "MAX_CONNECTIONS",
NULL);
if (max_connections <= 0)
&error);
if (error || max_connections < 0) {
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);
if (!session->db) {