mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix db reconnecting issues (#5590)
See:
c1b0d50237 (diff-02a32f437187bd4cbfab74877100fee0cfc669dab2c05418681a3557c2cf73f2R109)
We should be checking to see if the query is notActive. In this case, we're literally closing and reopening the connection to the database every time `checkSql()` is called, which is called in numerous places.
This commit is contained in:
parent
eb2c71d381
commit
8cbfe85ed4
1 changed files with 1 additions and 1 deletions
|
|
@ -108,7 +108,7 @@ bool Servatrice_DatabaseInterface::checkSql()
|
|||
}
|
||||
|
||||
auto query = QSqlQuery(sqlDatabase);
|
||||
if (query.exec("select 1") && query.isActive()) {
|
||||
if (query.exec("select 1") && !query.isActive()) {
|
||||
return openDatabase();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue