fix: 移除循环挂起
This commit is contained in:
parent
a706948504
commit
c8d3050c70
|
|
@ -8,7 +8,6 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v2/log"
|
||||
"github.com/google/uuid"
|
||||
|
|
@ -77,16 +76,7 @@ func (w *BotTool) BugOptimizationSubmit(ctx context.Context, requireData *entity
|
|||
// 记录 task_id 到 session_id 的映射
|
||||
w.SetTaskMapping(body.TaskId, requireData.Session)
|
||||
entitys.ResLog(requireData.Ch, requireData.Match.Index, "问题记录中")
|
||||
|
||||
// 等待异步回调完成再结束
|
||||
for {
|
||||
sessionID, ok := w.GetSessionByTaskID(body.TaskId)
|
||||
if !ok || sessionID != requireData.Session {
|
||||
break
|
||||
}
|
||||
entitys.ResLoading(requireData.Ch, requireData.Match.Index, "问题记录中...")
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue