Move jobs raw definition to their own namespace and the cascading fallout
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"local/firestormy/config"
|
||||
"local/firestormy/config/ns"
|
||||
"local/firestormy/scheduler"
|
||||
"time"
|
||||
)
|
||||
@@ -16,7 +18,8 @@ func toMap(j *scheduler.Job) map[string]interface{} {
|
||||
out["title"] = j.Title
|
||||
out["cron"] = j.Schedule
|
||||
out["language"] = j.Runner.String()
|
||||
out["script"] = j.Raw
|
||||
b, _ := config.Store.Get(j.Name, ns.JobsRaw...)
|
||||
out["script"] = string(b)
|
||||
out["last"] = map[string]interface{}{
|
||||
"run": j.LastRun.In(tz).Format(`2006-01-02 15:04:05 MST`),
|
||||
"runtime": j.LastRuntime.String(),
|
||||
|
||||
Reference in New Issue
Block a user