dont include job output without refresh
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user