发送时额外增加超时时间, 每5000条+1秒
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -15,7 +15,8 @@ func TestGamelog(t *testing.T) {
|
||||
glsdk, err := gamelog.INIT(&gamelog.SDKConfig{
|
||||
// 必填
|
||||
Pid: "test5", // 项目ID
|
||||
BaseUrl: "http://47.76.178.47:10101", // 香港测试服上报地址
|
||||
// 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, // 上报间隔
|
||||
|
||||
Reference in New Issue
Block a user