Skip to content

Commit

Permalink
fix: Delete param is end, not stop & start/end are expects timestamps
Browse files Browse the repository at this point in the history
* Delete parameter is `end` and not `stop`
* `end`and `stop` are timestamps

Cf: https://warp10.io/doc/DELETE
  • Loading branch information
nsteinmetz authored Jun 17, 2021
1 parent 1a19238 commit 3e6f401
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"strings"
"time"
"strconv"
)

// Exec execute a WarpScript on the backend, returning resultat as byte array
Expand Down Expand Up @@ -194,8 +195,8 @@ func (c *Client) Delete(selector Selector, start time.Time, stop time.Time) ([]b
if start.IsZero() && stop.IsZero() {
q.Add("deleteall", "")
} else {
q.Add("start", start.UTC().Format(time.RFC3339Nano))
q.Add("stop", stop.UTC().Format(time.RFC3339Nano))
q.Add("start", strconv.FormatInt(start.UnixNano()/1000, 10))
q.Add("end", strconv.FormatInt(stop.UnixNano()/1000, 10))
}
req.URL.RawQuery = q.Encode()

Expand Down

0 comments on commit 3e6f401

Please sign in to comment.