From 9c99508bdd0630178f845224c4096766b0d83699 Mon Sep 17 00:00:00 2001 From: yaodeshun Date: Thu, 30 Oct 2025 16:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=97=B6=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4,=20?= =?UTF-8?q?=E6=AF=8F5000=E6=9D=A1+1=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/gamelog/sdk.go | 2 +- package/gamelog/test/gamelog_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package/gamelog/sdk.go b/package/gamelog/sdk.go index f5232c1..fadc73f 100644 --- a/package/gamelog/sdk.go +++ b/package/gamelog/sdk.go @@ -390,7 +390,7 @@ func (sdk *SDK) flush() { // 发送消息 func (sdk *SDK) send(logs []GameLog) { - waitSecond := time.Duration(sdk.sdkConfig.FlushInterval/4) * time.Second + waitSecond := time.Duration(sdk.sdkConfig.FlushInterval/4)*time.Second + time.Second*time.Duration(gconv.Int(len(logs)/5000)) timeoutCtx, cancel := context.WithTimeout(context.Background(), waitSecond) defer cancel() data := make([][]any, 0, len(logs)) diff --git a/package/gamelog/test/gamelog_test.go b/package/gamelog/test/gamelog_test.go index ae66f06..6e648bd 100644 --- a/package/gamelog/test/gamelog_test.go +++ b/package/gamelog/test/gamelog_test.go @@ -14,8 +14,9 @@ import ( func TestGamelog(t *testing.T) { glsdk, err := gamelog.INIT(&gamelog.SDKConfig{ // 必填 - Pid: "test5", // 项目ID - BaseUrl: "http://47.76.178.47:10101", // 香港测试服上报地址 + Pid: "test5", // 项目ID + // BaseUrl: "http://47.76.178.47:10101", // 香港测试服上报地址 + BaseUrl: "http://101.37.28.111:10101", // 香港测试服上报地址 // BaseUrl: "http://127.0.0.1:10101", // 本次测试上报地址 ReportSk: "sngame2025", // xor混淆key FlushInterval: 5, // 上报间隔