#4460 #4424 Adding Exit() to the gRPC interface plus implemented test framework

This commit is contained in:
Gaute Lindkvist
2019-06-04 12:59:06 +02:00
parent 930abbf02f
commit 3530c8b3de
17 changed files with 146 additions and 79 deletions

View File

@@ -345,7 +345,10 @@ void RiaConsoleApplication::showErrorMessage(const QString& errMsg)
void RiaConsoleApplication::launchGrpcServer()
{
#ifdef ENABLE_GRPC
m_grpcServer->run();
m_grpcServer->runInThread();
m_idleTimer = new QTimer(this);
connect(m_idleTimer, SIGNAL(timeout()), this, SLOT(runIdleProcessing()));
m_idleTimer->start(0);
#endif
}
@@ -381,3 +384,21 @@ void RiaConsoleApplication::onProjectClosed()
processEvents();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaConsoleApplication::runIdleProcessing()
{
#ifdef ENABLE_GRPC
if (RiaGrpcServer::receivedExitRequest())
{
m_grpcServer->quit();
QCoreApplication::quit();
}
else
{
m_grpcServer->processAllQueuedRequests();
}
#endif
}