Skip to content

Commit

Permalink
Merge pull request #829 from distribworks/revert-813-show_scheduler_e…
Browse files Browse the repository at this point in the history
…ntries

Revert "feat: Include scheduler entries in status API"
  • Loading branch information
Victor Castell authored Oct 15, 2020
2 parents 41741f2 + 397d492 commit ba7da75
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions dkron/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"io/ioutil"
"net/http"
"sort"
"strconv"

"github.com/gin-contrib/expvar"
"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -117,21 +116,13 @@ func renderJSON(c *gin.Context, status int, v interface{}) {
func (h *HTTPTransport) indexHandler(c *gin.Context) {
local := h.agent.serf.LocalMember()

entries := map[string]string{}
for _, e := range h.agent.sched.Cron.Entries() {
if j, ok := e.Job.(*Job); ok {
entries[strconv.Itoa(int(e.ID))] = j.String()
}
}

stats := map[string]map[string]string{
"agent": {
"name": local.Name,
"version": Version,
},
"serf": h.agent.serf.Stats(),
"tags": local.Tags,
"scheduler": entries,
"serf": h.agent.serf.Stats(),
"tags": local.Tags,
}

renderJSON(c, http.StatusOK, stats)
Expand Down

0 comments on commit ba7da75

Please sign in to comment.