面包店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

task_cancel_order.go 380 B

10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
1234567891011121314151617181920212223
  1. package task
  2. import (
  3. "applet/app/task/svc"
  4. "math/rand"
  5. "time"
  6. "xorm.io/xorm"
  7. )
  8. // 取消订单
  9. func taskSyncCentralKitchenForSchoolPackageOrdState(eg *xorm.Engine) {
  10. for {
  11. if len(ch) > workerNum {
  12. time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000)))
  13. } else {
  14. goto START
  15. }
  16. }
  17. START:
  18. ch <- 1
  19. svc.SyncCentralKitchenForSchoolPackageOrdState(eg)
  20. <-ch
  21. }