chore: optimize rpc

This commit is contained in:
arm64v8a
2022-11-26 16:32:00 +09:00
parent 383b47e947
commit 09d37fa898
10 changed files with 157 additions and 176 deletions

View File

@@ -27,20 +27,9 @@ void MainWindow::setup_grpc() {
"127.0.0.1:" + Int2String(NekoRay::dataStore->core_port), NekoRay::dataStore->core_token);
auto t = new QTimer();
connect(t, &QTimer::timeout, this, [=]() {
bool ok = defaultClient->KeepAlive();
runOnUiThread([=]() {
if (!ok) {
title_error = tr("Error");
} else {
title_error = "";
}
refresh_status();
});
refresh_status();
});
auto tt = new QThread;
tt->start();
t->moveToThread(tt);
runOnUiThread([=] { t->start(2000); }, t);
t->start(2000);
// Looper
runOnNewThread([=] { NekoRay::traffic::trafficLooper->Loop(); });