Skip to content

Commit

Permalink
获取抢购用户信息失败后不再直接重新获取,而是重新请求一次抢购连接 在此重试
Browse files Browse the repository at this point in the history
  • Loading branch information
zqjzqj committed Jan 11, 2021
1 parent 8390b9c commit 8550781
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions secKill/jdSecKill.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,12 @@ func (jsk *jdSecKill) ReqSubmitSecKillOrder(ctx context.Context) error {
_, _, _, _ = page.Navigate(skUrl).WithReferrer("https://item.jd.com/"+jsk.SkuId+".html").Do(ctx)*/

logs.PrintlnInfo("获取抢购信息...............")
for {
err := jsk.GetSecKillInitInfo(ctx)
if err != nil {
logs.PrintErr("抢购失败:", err, "正在重试.......")
continue
}
break
err = jsk.GetSecKillInitInfo(ctx)
if err != nil {
logs.PrintErr("抢购失败:", err, "正在重试.......")
return err
}

orderData := jsk.GetOrderReqData()

if len(orderData) == 0 {
Expand Down

0 comments on commit 8550781

Please sign in to comment.