package task import ( "applet/app/task/svc" "math/rand" "time" ) //25结算上个月1-30结算订单 func taskHwStarbucksOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("starbucks") <-ch } func taskHwMovieOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("movie") <-ch } func taskHwMcdonaldOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("mcdonald") <-ch } func taskHwNayukiOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("nayuki") <-ch } func taskHwLuckinOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("luckin") <-ch } func taskHwPizzaOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("pizza") <-ch } func taskHwPagodaOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("pagoda") <-ch } func taskHwBurgerKingOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("burger_king") <-ch } func taskHwHeyteaOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("heytea") <-ch } func taskHwToKfcOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("to_kfc") <-ch } func taskHwWallaceOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("wallace") <-ch } func taskHwFlowerCakeOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("flowerCake") <-ch } func taskHwDeliveryOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("delivery") <-ch } func taskHwTourismOrder() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 svc.HwLoop("tourism") <-ch }