From c721bad3cf8f9f438155b033fefe46a92f9a1fda Mon Sep 17 00:00:00 2001 From: Pinenutn <1101839859@qq.com> Date: Mon, 14 Oct 2024 19:14:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E7=BC=93=E8=A7=A3#1034=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dice/ext_log.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dice/ext_log.go b/dice/ext_log.go index e39c7b80..dbf6fb1e 100644 --- a/dice/ext_log.go +++ b/dice/ext_log.go @@ -260,7 +260,7 @@ func RegisterBuiltinExtLog(self *Dice) { return CmdExecuteResult{Matched: true, Solved: true} } - getAndUpload(groupID, logName) + go getAndUpload(groupID, logName) return CmdExecuteResult{Matched: true, Solved: true} } else if cmdArgs.IsArgEqual(1, "get") { logName := group.LogCurName @@ -274,7 +274,7 @@ func RegisterBuiltinExtLog(self *Dice) { return CmdExecuteResult{Matched: true, Solved: true} } - getAndUpload(group.GroupID, logName) + go getAndUpload(group.GroupID, logName) return CmdExecuteResult{Matched: true, Solved: true} } else if cmdArgs.IsArgEqual(1, "end") { if group.LogCurName == "" { @@ -294,7 +294,7 @@ func RegisterBuiltinExtLog(self *Dice) { group.UpdatedAtTime = time.Now().Unix() time.Sleep(time.Duration(0.3 * float64(time.Second))) - getAndUpload(group.GroupID, group.LogCurName) + go getAndUpload(group.GroupID, group.LogCurName) group.LogCurName = "" group.UpdatedAtTime = time.Now().Unix() return CmdExecuteResult{Matched: true, Solved: true} From 328a389d7b8fb6e65188cdcad93a7049dc99482c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=BE=E6=81=A9=E7=BA=B3=E7=89=B9?= <1101839859@qq.com> Date: Tue, 15 Oct 2024 19:36:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=8F=AA=E4=BF=9D=E7=95=99log=20end?= =?UTF-8?q?=E7=9A=84=E5=8D=8F=E7=A8=8B=EF=BC=8C=E5=90=8C=E6=97=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dice/ext_log.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dice/ext_log.go b/dice/ext_log.go index dbf6fb1e..87507393 100644 --- a/dice/ext_log.go +++ b/dice/ext_log.go @@ -260,7 +260,7 @@ func RegisterBuiltinExtLog(self *Dice) { return CmdExecuteResult{Matched: true, Solved: true} } - go getAndUpload(groupID, logName) + getAndUpload(groupID, logName) return CmdExecuteResult{Matched: true, Solved: true} } else if cmdArgs.IsArgEqual(1, "get") { logName := group.LogCurName @@ -274,7 +274,7 @@ func RegisterBuiltinExtLog(self *Dice) { return CmdExecuteResult{Matched: true, Solved: true} } - go getAndUpload(group.GroupID, logName) + getAndUpload(group.GroupID, logName) return CmdExecuteResult{Matched: true, Solved: true} } else if cmdArgs.IsArgEqual(1, "end") { if group.LogCurName == "" { @@ -294,6 +294,7 @@ func RegisterBuiltinExtLog(self *Dice) { group.UpdatedAtTime = time.Now().Unix() time.Sleep(time.Duration(0.3 * float64(time.Second))) + // Note: 2024-10-15 经过简单测试,似乎能缓解#1034的问题,但无法根本解决。 go getAndUpload(group.GroupID, group.LogCurName) group.LogCurName = "" group.UpdatedAtTime = time.Now().Unix()