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, // 上报间隔