marion před 5 roky
rodič
revize
8947bc5448
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      utils/queue/chan_pool.go

+ 3 - 3
utils/queue/chan_pool.go

@@ -32,10 +32,10 @@ func NewChanWorker(workerId, capacity int, workerPool chan chan interface{}) *Ch
 }
 
 func (w *ChanWorker) Start(callback func(workerId int, msg interface{})) {
-	// 新工作管道加入工作管道池
-	w.WorkerPool <- w.JobChannel
-
 	go func(w *ChanWorker, callback func(workerId int, msg interface{})) {
+		// 新工作管道加入工作管道池
+		w.WorkerPool <- w.JobChannel
+
 		defer utils.DefaultGoroutineRecover(nil, `chan池工作对象消息处理`)
 		for {
 			select {