diff options
-rw-r--r-- | common/resourceaccess.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index fe4293d..66684c3 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -181,7 +181,7 @@ KAsync::Job<void> ResourceAccess::Private::tryToConnect() | |||
181 | static int timeout = 20000; | 181 | static int timeout = 20000; |
182 | static int maxRetries = timeout / waitTime; | 182 | static int maxRetries = timeout / waitTime; |
183 | if (*counter > maxRetries) { | 183 | if (*counter > maxRetries) { |
184 | SinkTrace() << "Giving up"; | 184 | SinkTrace() << "Giving up after " << *counter << "tries"; |
185 | return KAsync::error<KAsync::ControlFlowFlag>("Failed to connect to socket"); | 185 | return KAsync::error<KAsync::ControlFlowFlag>("Failed to connect to socket"); |
186 | } else { | 186 | } else { |
187 | *counter = *counter + 1; | 187 | *counter = *counter + 1; |
@@ -222,7 +222,7 @@ KAsync::Job<void> ResourceAccess::Private::initializeSocket() | |||
222 | SinkTrace() << "Started resource " << pid; | 222 | SinkTrace() << "Started resource " << pid; |
223 | return tryToConnect() | 223 | return tryToConnect() |
224 | .onError([this, args](const KAsync::Error &error) { | 224 | .onError([this, args](const KAsync::Error &error) { |
225 | SinkWarning() << "Failed to connect to started resource: sink_synchronizer " << args; | 225 | SinkError() << "Failed to connect to started resource: sink_synchronizer " << args; |
226 | }); | 226 | }); |
227 | } else { | 227 | } else { |
228 | SinkError() << "Failed to start resource"; | 228 | SinkError() << "Failed to start resource"; |
@@ -429,10 +429,11 @@ void ResourceAccess::open() | |||
429 | [this, time](const KAsync::Error &error) { | 429 | [this, time](const KAsync::Error &error) { |
430 | d->openingSocket = false; | 430 | d->openingSocket = false; |
431 | if (error) { | 431 | if (error) { |
432 | SinkWarning() << "Failed to initialize socket " << error.errorMessage; | 432 | SinkError() << "Failed to initialize socket " << error.errorMessage; |
433 | d->abortPendingOperations(); | 433 | d->abortPendingOperations(); |
434 | } else { | 434 | } else { |
435 | SinkTrace() << "Socket is initialized." << Log::TraceTime(time->elapsed()); | 435 | SinkTrace() << "Socket is initialized." << Log::TraceTime(time->elapsed()); |
436 | Q_ASSERT(d->socket); | ||
436 | QObject::connect(d->socket.data(), &QLocalSocket::disconnected, this, &ResourceAccess::disconnected); | 437 | QObject::connect(d->socket.data(), &QLocalSocket::disconnected, this, &ResourceAccess::disconnected); |
437 | QObject::connect(d->socket.data(), SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(connectionError(QLocalSocket::LocalSocketError))); | 438 | QObject::connect(d->socket.data(), SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(connectionError(QLocalSocket::LocalSocketError))); |
438 | QObject::connect(d->socket.data(), &QIODevice::readyRead, this, &ResourceAccess::readResourceMessage); | 439 | QObject::connect(d->socket.data(), &QIODevice::readyRead, this, &ResourceAccess::readResourceMessage); |