Wait forever until reconnect, the fallthrough case had us retrying the sql on a closed connection which may have led to a crash.
parent
89de8b7765
commit
b9da90522b
|
@ -199,10 +199,11 @@ int zmDbDo(const std::string &query) {
|
|||
while ((rc = mysql_query(&dbconn, query.c_str())) and !zm_terminate) {
|
||||
if (mysql_ping(&dbconn)) {
|
||||
// Was a connection error
|
||||
if (!zmDbReconnect()) {
|
||||
while (!zmDbReconnect() and !zm_terminate) {
|
||||
// If we failed. Sleeping 1 sec may be way too much.
|
||||
sleep(1);
|
||||
}
|
||||
if (zm_terminate) return 0;
|
||||
} else {
|
||||
// Not a connection error
|
||||
Error("Can't run query %s: %s", query.c_str(), mysql_error(&dbconn));
|
||||
|
|
Loading…
Reference in New Issue