Skip to content

Commit

Permalink
bugfix: ignore deleted metrics in tags autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
lomik committed Jun 11, 2018
1 parent 8860605 commit e03317c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autocomplete/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (h *Handler) ServeTags(w http.ResponseWriter, r *http.Request) {

fromDate := time.Now().AddDate(0, 0, -h.config.ClickHouse.TaggedAutocompleDays)
where.Andf("Date >= '%s'", fromDate.Format("2006-01-02"))
where.Andf("Deleted = 0")

sql := fmt.Sprintf("SELECT %s FROM %s %s GROUP BY value ORDER BY value LIMIT %d",
valueSQL,
Expand Down Expand Up @@ -219,6 +220,7 @@ func (h *Handler) ServeValues(w http.ResponseWriter, r *http.Request) {

fromDate := time.Now().AddDate(0, 0, -h.config.ClickHouse.TaggedAutocompleDays)
where.Andf("Date >= '%s'", fromDate.Format("2006-01-02"))
where.Andf("Deleted = 0")

sql := fmt.Sprintf("SELECT %s FROM %s %s GROUP BY value ORDER BY value LIMIT %d",
valueSQL,
Expand Down

0 comments on commit e03317c

Please sign in to comment.