mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add try and catch for reconnect attempt
This commit is contained in:
parent
de11450c90
commit
5582eefae6
@ -75,7 +75,14 @@ Poco::Data::Session ConnectionManager::getConnection(ConnectionType type)
|
||||
auto session = mSessionPools.getPool(mSessionPoolNames[type]).get();
|
||||
if (!session.isConnected()) {
|
||||
printf("reconnect called\n");
|
||||
session.reconnect();
|
||||
try {
|
||||
session.reconnect();
|
||||
}
|
||||
catch (Poco::Exception& e) {
|
||||
addError(new ParamError("[ConnectionManager::getConnection]", "reconnect throw exception, try with next new one, without further check", e.displayText()));
|
||||
sendErrorsAsEmail();
|
||||
return mSessionPools.getPool(mSessionPoolNames[type]).get();
|
||||
}
|
||||
}
|
||||
//std::string dateTimeString = Poco::DateTimeFormatter::format(Poco::DateTime(), "%d.%m.%y %H:%M:%S");
|
||||
//printf("[getConnection] %s impl: %p\n", dateTimeString.data(), session.impl());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user