增加 command -> delayMillSecond 参数
This commit is contained in:
parent
c1affe1109
commit
7cb0231a1d
@ -129,7 +129,7 @@ func initWatcher() {
|
||||
defer watcher.Close()
|
||||
|
||||
done := make(chan bool)
|
||||
taskMan = newTaskMan(2000)
|
||||
taskMan = newTaskMan(cfg.Command.DelayMillSecond)
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
@ -10,8 +10,7 @@ type FileGirl struct {
|
||||
ExceptDirs []string `yaml:"exceptDirs"`
|
||||
}
|
||||
Command struct {
|
||||
//BeforeExec string `yaml:"beforeExec"`
|
||||
Exec []string `yaml:"exec"`
|
||||
//AfterExec string `yaml:"afterExec"`
|
||||
Exec []string `yaml:"exec"`
|
||||
DelayMillSecond int `yaml:"delayMillSecond"`
|
||||
}
|
||||
}
|
||||
|
8
raw.go
8
raw.go
@ -46,7 +46,13 @@ command:
|
||||
exec:
|
||||
- go version
|
||||
- go env
|
||||
- echo {{file}}
|
||||
|
||||
# 文件变更后命令会在xx毫秒后才会执行,单位为毫秒
|
||||
# 一个变更事件(A)如果在定义的延迟时间(t)内,又有新的文件变更事件(B),那么A会取消执行。
|
||||
# B及以后的事件均依次类推,直到事件Z在t内没有新事件产生,Z 会执行
|
||||
# 合理设置延迟时间,将有效减少冗余和重复任务的执行
|
||||
# 如果不需要该特性,设置为 0
|
||||
delayMillSecond: 1000
|
||||
`
|
||||
|
||||
var firstRunHelp = `第一次运行 fileboy ?
|
||||
|
Loading…
Reference in New Issue
Block a user