fix: action not running

feat/muzan
Evan Chen 2021-11-12 15:08:34 +08:00
parent 3327182dc0
commit 4b1ad5b791
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ import (
var UNIX_SHELL = "/usr/bin/sh" var UNIX_SHELL = "/usr/bin/sh"
var WIN_SHELL = "C:\\Windows\\System32\\cmd" var WIN_SHELL = "C:\\Windows\\System32\\cmd"
const version = "v0.1.11" const version = "v0.1.12"
//go:embed templates //go:embed templates
var tmplFS embed.FS var tmplFS embed.FS

View File

@ -145,7 +145,7 @@ func (cui *ConfigUI) DoAction(w http.ResponseWriter, r *http.Request) {
panic(fmt.Errorf("another task of %s is running with pid: %d", name, v.pid)) panic(fmt.Errorf("another task of %s is running with pid: %d", name, v.pid))
} }
file := &File{Name: name, Action: v.Cmd, owner: cui} file := &File{Name: name, Cmd: v.Cmd, owner: cui}
go func() { go func() {
<-time.After(time.Millisecond * 10) <-time.After(time.Millisecond * 10)
cui.Actions[i].pid = file.pid cui.Actions[i].pid = file.pid