Browse Source

bug log++

main
songzhibin97 4 years ago
parent
commit
67e3efb386
  1. 1
      server/utils/cmd_Task.go
  2. 5
      server/utils/cmd_monitor.go

1
server/utils/cmd_Task.go

@ -60,6 +60,7 @@ func (t *T) AddTask() {
// 直接丢弃这次任务
return
}
fmt.Println("::::发送任务->>>>>>>>")
t.ch <- struct{}{}
}

5
server/utils/cmd_monitor.go

@ -124,12 +124,15 @@ func (w *Watch) watchFile(path string) error {
// chickPower: 判断是否在可控范围内
func chickPower(name string) bool {
return filepath.Ext(name) == ".go" || filepath.Ext(name) == ".yaml"
name = filepath.Ext(name)
fmt.Println(name)
return name == ".go" || name == ".yaml"
}
// addTask: 偏函数 简化发送任务
func (w *Watch) addTask(t *T, name string) {
if chickPower(name) {
fmt.Println("Add Task->>>>>>")
t.AddTask()
}
}
Loading…
Cancel
Save