From 0e57baf7843e7f8ca6b85e6b7c4eec0f7853ee44 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 22 Jun 2021 12:22:59 +0200 Subject: [PATCH] Docker: Raise number of iterations when starting container On Windows this call takes way longer to write to the cidfile. Beside this, read only from file if it could be opened to silence some Qt internal warnings. Change-Id: Iec5f631aaf871995c1903289d7a0a24abc2f8e05 Reviewed-by: hjk --- src/plugins/docker/dockerdevice.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index bcdcede17cc..22d64ef07d1 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -596,15 +596,16 @@ void DockerDevicePrivate::tryCreateLocalFileAccess() } LOG("CHECKING: " << tempFileName); - for (int i = 0; i <= 10; ++i) { + for (int i = 0; i <= 20; ++i) { QFile file(tempFileName); - file.open(QIODevice::ReadOnly); - m_container = QString::fromUtf8(file.readAll()).trimmed(); - if (!m_container.isEmpty()) { - LOG("Container: " << m_container); - break; + if (file.open(QIODevice::ReadOnly)) { + m_container = QString::fromUtf8(file.readAll()).trimmed(); + if (!m_container.isEmpty()) { + LOG("Container: " << m_container); + break; + } } - if (i == 10) { + if (i == 20) { qWarning("Docker cid file empty."); return; // No }