fix: 还原循环挂起
This commit is contained in:
parent
c8d3050c70
commit
aba8a18900
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2/log"
|
"github.com/gofiber/fiber/v2/log"
|
||||||
"github.com/google/uuid"
|
"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.ResLog(requireData.Ch, requireData.Match.Index, "问题记录中")
|
||||||
entitys.ResLoading(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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue