Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
Signed-off-by: Musilah <[email protected]>
  • Loading branch information
Musilah committed Feb 23, 2024
1 parent 74f2227 commit e8b0dc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions pkg/sdk/go/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func (sdk mgSDK) SendMessage(chanName, msg, key string) errors.SDKError {
subtopicPart = fmt.Sprintf("/%s", strings.ReplaceAll(chanNameParts[1], ".", "/"))
}

url := fmt.Sprintf("%s/channels/%s/messages%s", sdk.httpAdapterURL, chanID, subtopicPart)
reqUrl := fmt.Sprintf("%s/channels/%s/messages%s", sdk.httpAdapterURL, chanID, subtopicPart)

_, _, err := sdk.processRequest(http.MethodPost, url, ThingPrefix+key, []byte(msg), nil, http.StatusAccepted)
_, _, err := sdk.processRequest(http.MethodPost, reqUrl, ThingPrefix+key, []byte(msg), nil, http.StatusAccepted)

return err
}
Expand All @@ -41,17 +41,15 @@ func (sdk mgSDK) ReadMessages(pm MessagePageMeta, chanName, token string) (Messa
}

readMessagesEndpoint := fmt.Sprintf("channels/%s/messages%s", chanID, subtopicPart)
url, err := sdk.withMessageQueryParams(sdk.readerURL, readMessagesEndpoint, pm)
msgUrl, err := sdk.withMessageQueryParams(sdk.readerURL, readMessagesEndpoint, pm)
if err != nil {
return MessagesPage{}, errors.NewSDKError(err)
}

fmt.Println("sdk url: ", url)

header := make(map[string]string)
header["Content-Type"] = string(sdk.msgContentType)

_, body, sdkerr := sdk.processRequest(http.MethodGet, url, token, nil, header, http.StatusOK)
_, body, sdkerr := sdk.processRequest(http.MethodGet, msgUrl, token, nil, header, http.StatusOK)
if sdkerr != nil {
return MessagesPage{}, sdkerr
}
Expand Down
2 changes: 0 additions & 2 deletions readers/timescale/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ func (tr timescaleRepository) ReadAll(chanID string, rpm readers.PageMetadata) (
format = rpm.Format
}

fmt.Println("time interval: ", rpm.Interval)

q := fmt.Sprintf(`SELECT EXTRACT(epoch FROM time_bucket('%s', to_timestamp(time))) AS time, %s(value) AS value FROM %s WHERE %s GROUP BY 1 ORDER BY 1 DESC LIMIT :limit OFFSET :offset;`, rpm.Interval, rpm.Aggregation, format, fmtCondition(chanID, rpm))

params := map[string]interface{}{
Expand Down

0 comments on commit e8b0dc9

Please sign in to comment.