add timeout for api calls

This commit is contained in:
Nova 2025-02-28 16:51:44 +03:30
parent 343ff659fc
commit 55ee8212dc
2 changed files with 1 additions and 3 deletions

View File

@ -11,7 +11,6 @@ import (
"nekobox_core/internal/boxdns/winipcfg"
"net/netip"
"strings"
"time"
)
const (
@ -24,7 +23,6 @@ var dnsIsSet bool
func HandleInterfaceChange(_ *control.Interface, _ int) {
monitorForUnderlyingDNS()
time.Sleep(2 * time.Second)
if !dnsIsSet {
return
}

View File

@ -145,7 +145,7 @@ namespace QtGrpc {
QNetworkReply::NetworkError Call(const QString &methodName,
const google::protobuf::Message &req, google::protobuf::Message *rsp,
int timeout_ms = 0) {
int timeout_ms = 2000) {
if (!NekoGui::dataStore->core_running) return QNetworkReply::NetworkError(-1919);
std::string reqStr;