Reload job in ui

This commit is contained in:
bel
2020-03-15 23:04:48 +00:00
parent 0971908da7
commit fd71221cbf
12 changed files with 275 additions and 93 deletions

View File

@@ -20,12 +20,12 @@ type Job struct {
Schedule string
Raw string
Runner Runner
Disabled bool
foo func()
LastStatus int
LastOutput string
LastRuntime time.Duration
LastRun time.Time
Disabled bool
}
func NewJob(runner Runner, schedule, raw string) (*Job, error) {
@@ -59,7 +59,7 @@ func newBashJob(schedule, sh string, title ...string) (*Job, error) {
out, err := cmd.CombinedOutput()
j.LastRuntime = time.Since(start)
if err != nil {
out = []byte(fmt.Sprintf("error running command: %v: %v", err, out))
out = []byte(fmt.Sprintf("error running command: %v: %s", err, out))
}
j.LastOutput = strings.TrimSpace(string(out))
if cmd != nil && cmd.ProcessState != nil {