Skip to content

Commit

Permalink
Update input plugin exec
Browse files Browse the repository at this point in the history
  • Loading branch information
luopengift committed Sep 17, 2017
1 parent 9000e4a commit e34cf57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions plugins/input/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const (
)

type ExecInput struct {
Commands []string `json:"commands"`
Crontab string `json:"cron"`
Commands []string `json:"commands"`
Crontab string `json:"cron"`

result chan []byte
errchan chan error
Expand All @@ -30,16 +30,16 @@ func (in *ExecInput) Init(config transport.Configer) error {
}
in.result = make(chan []byte, 1)
in.errchan = make(chan error, 1)
for _, command := range in.Commands {
cmd := command
transport.AddCronTask(
cmd,
in.Crontab,
func() error {
return in.run(cmd)
},
)
}
for _, command := range in.Commands {
cmd := command
transport.AddCronTask(
cmd,
in.Crontab,
func() error {
return in.run(cmd)
},
)
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion test/scripts/go.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package main
import "fmt"

func main() {
fmt.Println("golang program testing...")
fmt.Println("golang program testing...")
}

0 comments on commit e34cf57

Please sign in to comment.