Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Removed unnecessary http client from uuid and date resolver.
Browse files Browse the repository at this point in the history
Added log for testing.
  • Loading branch information
bogdanguranda committed Nov 21, 2017
1 parent 2e3c6b7 commit bcc053a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions resolver/uuidResolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package resolver
import (
"encoding/json"
"fmt"
"net/http"
"time"

"github.com/Financial-Times/uuid-utils-go"
Expand All @@ -21,8 +20,6 @@ type UuidsAndDate struct {
}

type fromRequestResolver struct {
httpClient *http.Client
relationsApiUrl string
}

func NewUuidResolver() UuidsAndDateResolver {
Expand All @@ -36,7 +33,7 @@ func (r *fromRequestResolver) Resolve(reqData []byte) (UuidsAndDate, error) {
return UuidsAndDate{}, fmt.Errorf("Unmarshalling error: %v", err)
}

uuidArr, err := r.resolveUuids(cc)
uuidArr, err := resolveUuids(cc)
if err != nil {
return UuidsAndDate{}, err
}
Expand All @@ -49,7 +46,7 @@ func (r *fromRequestResolver) Resolve(reqData []byte) (UuidsAndDate, error) {
return UuidsAndDate{uuidArr, lastModified}, nil
}

func (r *fromRequestResolver) resolveUuids(cc contentCollection) ([]string, error) {
func resolveUuids(cc contentCollection) ([]string, error) {
var uuidArr []string
for _, item := range cc.Items {
err := uuidutils.ValidateUUID(item.Uuid)
Expand Down
1 change: 1 addition & 0 deletions unfolder.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (u *unfolder) handle(writer http.ResponseWriter, req *http.Request) {
writeError(writer, http.StatusBadRequest, err)
return
}
log.Infof("Message with tid=%v, contentCollectionUuid=%v, collectionType=%v. Incoming items:%v", tid, uuid, collectionType, uuidsAndDate.UuidArr)

oldCollectionRelations, err := u.relationsResolver.Resolve(uuid, tid)
if err != nil {
Expand Down

0 comments on commit bcc053a

Please sign in to comment.