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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user