|
|
@ -126,7 +126,6 @@ mySQL::mySQL(const string _path, const string _username, const string _password, |
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<con.size() && runBot; i++) { |
|
|
|
for (int i=0; i<con.size() && runBot; i++) { |
|
|
|
if (!con[i]->isValid()) { |
|
|
|
if (!con[i]->isValid()) { |
|
|
|
cout << "Connection is not valid, remove it from pool!" << endl; |
|
|
|
|
|
|
|
io.lock(); |
|
|
|
io.lock(); |
|
|
|
con.erase(con.begin()+i); |
|
|
|
con.erase(con.begin()+i); |
|
|
|
io.unlock(); |
|
|
|
io.unlock(); |
|
|
@ -323,7 +322,5 @@ Connection* mySQL::shift_con() { |
|
|
|
mySQL::~mySQL() { |
|
|
|
mySQL::~mySQL() { |
|
|
|
runBot = false; |
|
|
|
runBot = false; |
|
|
|
bot.get(); |
|
|
|
bot.get(); |
|
|
|
if(disconnect()) { |
|
|
|
disconnect(); |
|
|
|
throw string("[ERROR] Unable to close database "); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |