dont include job output without refresh

This commit is contained in:
Bel LaPointe
2021-09-28 10:38:54 -06:00
parent 2cd9f5ea4d
commit 7db42cf5f0
3 changed files with 7 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ import (
"time"
)
func toMap(j *scheduler.Job) map[string]interface{} {
func toMap(j *scheduler.Job, output bool) map[string]interface{} {
tz, err := time.LoadLocation("America/Denver")
if err != nil {
panic(err)
@@ -23,8 +23,10 @@ func toMap(j *scheduler.Job) map[string]interface{} {
out["last"] = map[string]interface{}{
"run": j.LastRun.In(tz).Format(`2006-01-02 15:04:05 MST`),
"runtime": j.LastRuntime.String(),
//"output": j.LastOutput,
"status": j.LastStatus,
"status": j.LastStatus,
}
if output {
out["last"].(map[string]interface{})["output"] = j.LastOutput
}
return out
}