Browse Source

增加缓冲区

xiexiaoyuan 2 years ago
parent
commit
8b164be796
1 changed files with 3 additions and 1 deletions
  1. 3 1
      task/task.go

+ 3 - 1
task/task.go

@@ -18,7 +18,7 @@ var taskList chan *Executor  //任务列表
 var once sync.Once
 func GetTaskList() chan *Executor {
 	once.Do(func() {
-		taskList = make(chan *Executor)
+		taskList = make(chan *Executor, 10000)
 	})
 	return taskList
 }
@@ -53,6 +53,8 @@ func (e *Executor) Exec()  {       //执行任务
 			go services.SendEmail(utils.APPNAME+"崩了"+time.Now().Format("2006-01-02 15:04:05"), stack, utils.EmailSendToUsers)
 		}
 	}()
+	//fmt.Println("i am here")
+	//time.Sleep(60*time.Second)
 	e.f(e.params...)
 }