Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:jalapeno-api-gateway/request-servic…
Browse files Browse the repository at this point in the history
…e into main
  • Loading branch information
mbongard committed Mar 2, 2022
2 parents cb20c60 + 21aa385 commit 848e91c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions influxdb/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func Fetch(logger *logrus.Entry, request *jagw.TelemetryRequest) []string {
}

func formatSelection(properties []string) string {
if len(properties) == 0 {
return "*"
}

var b strings.Builder
for i, property := range properties {
b.Reset()
Expand Down Expand Up @@ -141,10 +145,10 @@ func formatFilters(request *jagw.TelemetryRequest) string {
if request.RangeFilter == nil {
return b.String() + " limit 1"
} else {
if len(request.StringFilters) > 0 {
if b.Len() > 0 {
formatRangeFilter(" AND ", &b, request.RangeFilter)
} else {
formatRangeFilter(" ", &b, request.RangeFilter)
formatRangeFilter("WHERE ", &b, request.RangeFilter)

}
return b.String()
Expand Down

0 comments on commit 848e91c

Please sign in to comment.