Skip to content

Commit 82af4e0

Browse files
xmichelocuthix
authored andcommitted
feat(GODT-2364): wait and retry once if the gRPC service config file exists but cannot be opened.
1 parent 9ad5f74 commit 82af4e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/frontend/bridge-gui/bridgepp/bridgepp/GRPC/GRPCConfig.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,13 @@ bool GRPCConfig::load(QString const &path, QString *outError) {
7878
try {
7979
QFile file(path);
8080
if (!file.exists())
81-
throw Exception("The file service configuration file does not exist.");
81+
throw Exception("The gRPC service configuration file does not exist.");
8282

8383
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
84-
throw Exception("The file exists but cannot be opened.");
84+
QThread::msleep(500); // we wait a bit and retry once, just in case server is not done writing/moving the config file.
85+
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
86+
throw Exception("The gRPC service configuration file exists but cannot be opened.");
87+
}
8588
}
8689

8790
QJsonDocument const doc = QJsonDocument::fromJson(file.readAll());

0 commit comments

Comments
 (0)