marion 5 tahun lalu
induk
melakukan
8947bc5448
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  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 {