diff --git a/pkg/sdk/go/message.go b/pkg/sdk/go/message.go index 1ef72864620..fdfc6b0594a 100644 --- a/pkg/sdk/go/message.go +++ b/pkg/sdk/go/message.go @@ -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 } @@ -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 } diff --git a/readers/timescale/messages.go b/readers/timescale/messages.go index 6937b81a60c..a9367fd737a 100644 --- a/readers/timescale/messages.go +++ b/readers/timescale/messages.go @@ -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{}{