We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36651ae commit 9da59f5Copy full SHA for 9da59f5
src/trainer/sample_trainer.cpp
@@ -138,8 +138,14 @@ SampleTrainer::actionImpl()
138
while (M_rpc_client->isConnected() == false)
139
{
140
std::cout<<"Connecting to GRPC server..."<<std::endl;
141
- connectedToGrpcServer = M_rpc_client->connectToGrpcServer();
142
- if (connectedToGrpcServer == false) {
+ try{
+ connectedToGrpcServer = M_rpc_client->connectToGrpcServer();
143
+ if (connectedToGrpcServer == false) {
144
+ std::this_thread::sleep_for(std::chrono::seconds(1));
145
+ }
146
147
+ catch (const std::exception& e){
148
+ std::cerr << "Error: " << e.what() << std::endl;
149
std::this_thread::sleep_for(std::chrono::seconds(1));
150
}
151
0 commit comments