feat: Make log writing in other thread.
This commit is contained in:
@@ -25,6 +25,7 @@ DmsSyncAction::DmsSyncAction(int aServerId, int aActionId, QObject* aObject, con
|
||||
{
|
||||
mTimer->setSingleShot(true);
|
||||
connect(mObject, ("2" + mSignal).toStdString().c_str(), this, SLOT(saveActionResult(const QString&)));
|
||||
connect(mObject, ("2" + mSignal).toStdString().c_str(), mTimer, SLOT(stop()));
|
||||
connect(mObject, ("2" + mSignal).toStdString().c_str(), mLoop, SLOT(quit()));
|
||||
connect(mTimer, &QTimer::timeout, mLoop, &QEventLoop::quit);
|
||||
}
|
||||
@@ -49,6 +50,7 @@ DmsSyncActionResult DmsSyncAction::execute()
|
||||
LOG_SYS_OPERATION(QString("GUI -> DMS : %1-%2, Message:%3").arg(mServerId).arg(mActionId).arg(mSendData));
|
||||
if(!waitUntilSignalReceived())
|
||||
{
|
||||
LOG_SYS_OPERATION(QString("GUI -> DMS : %1-%2, Time out.").arg(mServerId).arg(mActionId));
|
||||
DmsSyncActionResult result(false, "time out");
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user