mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
wait on mysql
This commit is contained in:
parent
05526c361f
commit
15bff50291
@ -82,6 +82,22 @@ int load(int argc, char* argv[]) {
|
||||
auto conn = ConnectionManager::getInstance();
|
||||
//conn->setConnection()
|
||||
//printf("try connect login server mysql db\n");
|
||||
try {
|
||||
conn->setConnectionsFromConfig(*test_config, CONNECTION_MYSQL_LOGIN_SERVER);
|
||||
}
|
||||
catch (Poco::Exception& ex) {
|
||||
// maybe we in docker environment and db needs some time to start up
|
||||
// let's wait 10 seconds
|
||||
int count = 10;
|
||||
while (count > 0) {
|
||||
printf("\rwait on mysql/mariadb %d seconds...", count);
|
||||
count--;
|
||||
Poco::Thread::sleep(1000);
|
||||
}
|
||||
conn->setConnectionsFromConfig(*test_config, CONNECTION_MYSQL_LOGIN_SERVER);
|
||||
}
|
||||
std::clog << "Wait another 10 seconds for mysql/mariadb" << std::endl;
|
||||
Poco::Thread::sleep(10000);
|
||||
try {
|
||||
conn->setConnectionsFromConfig(*test_config, CONNECTION_MYSQL_LOGIN_SERVER);
|
||||
} catch(Poco::Exception& ex) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user