fix: 还原循环挂起

This commit is contained in:
fuzhongyun 2025-11-27 15:35:57 +08:00
parent c8d3050c70
commit aba8a18900
1 changed files with 11 additions and 0 deletions

View File

@ -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
}