diff --git a/internal/tools_bot/bug_optimization_submit.go b/internal/tools_bot/bug_optimization_submit.go index 71b7dd7..1bb2d31 100644 --- a/internal/tools_bot/bug_optimization_submit.go +++ b/internal/tools_bot/bug_optimization_submit.go @@ -8,6 +8,7 @@ import ( "context" "encoding/json" "fmt" + "time" "github.com/gofiber/fiber/v2/log" "github.com/google/uuid" @@ -78,6 +79,16 @@ func (w *BotTool) BugOptimizationSubmit(ctx context.Context, requireData *entity entitys.ResLog(requireData.Ch, requireData.Match.Index, "问题记录中") entitys.ResLoading(requireData.Ch, requireData.Match.Index, "问题记录中...") + // 等待异步回调完成再结束 + for { + sessionID, ok := w.GetSessionByTaskID(body.TaskId) + if !ok || sessionID != requireData.Session { + break + } + + time.Sleep(time.Second * 2) + } + return }