package task import ( "applet/app/task/svc" "applet/app/utils" "fmt" "math/rand" "time" ) func taskSuccessLifeOrderSettle() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 month := utils.GetTimeRange("current_month") fmt.Println(month) arg := map[string]string{ "status": "订单完成,订单成功", "sort": "id desc", "is_to_settle": "2", "is_commission": "1", "to_settle_time": utils.Int64ToStr(month["start"]), "p": "1", "size": "100", "pvd": "own_t3car", } svc.LifeOrderSettle(arg) <-ch }