Skip to content

Commit

Permalink
Merge pull request #3 from sepehrsoh/fix/reverse-log
Browse files Browse the repository at this point in the history
fix reserve logs
  • Loading branch information
pedy4000 authored Oct 28, 2024
2 parents 4dafc31 + cb9364c commit 752870e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
25 changes: 9 additions & 16 deletions services/reverse/reverse_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/snapp-incubator/smapp-sdk-go/config"
"github.com/snapp-incubator/smapp-sdk-go/version"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
"net/url"

"github.com/snapp-incubator/smapp-sdk-go/config"
"github.com/snapp-incubator/smapp-sdk-go/version"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
)

// GetBatch , receives a slice of Request s and returns Component s of address of location given.
Expand All @@ -41,7 +41,7 @@ func (c *Client) GetBatchWithContext(ctx context.Context, request BatchReverseRe

jsonBody, err := json.Marshal(request)
if err != nil {
log.Fatal(err)
return nil, errors.New("smapp batch reverse geo-code: could not mar request. err: " + err.Error())
}

req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.url, bytes.NewBuffer(jsonBody))
Expand Down Expand Up @@ -125,7 +125,7 @@ func (c *Client) GetBatchDisplayNameWithContext(ctx context.Context, request Bat
if err != nil {
log.Fatal(err)
}
fmt.Println(string(jsonBody))

req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.url, bytes.NewBuffer(jsonBody))
if err != nil {
reqInitSpan.RecordError(err)
Expand Down Expand Up @@ -168,15 +168,8 @@ func (c *Client) GetBatchDisplayNameWithContext(ctx context.Context, request Bat

var results ResultsWithDisplayName

respDump, err := httputil.DumpResponse(response, true)
if err != nil {
log.Fatal(err)
}

fmt.Println(string(respDump))

if response.StatusCode == http.StatusOK {
err := json.NewDecoder(response.Body).Decode(&results)
err = json.NewDecoder(response.Body).Decode(&results)
if err != nil {
responseSpan.RecordError(err)
responseSpan.End()
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package version
import "fmt"

const (
Version = "v0.9.15"
Version = "v0.9.16"
UserAgentHeader = "User-Agent"
)

Expand Down

0 comments on commit 752870e

Please sign in to comment.