diff --git a/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go b/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go index adfc36f8d3..be0252f930 100644 --- a/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go +++ b/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go @@ -233,7 +233,7 @@ func (b *LyticsBulkUploader) createCSVFile(existingFilePath string, streamTraits return actionFile, nil } -func convertGjsonToStreamTraitMapping(result gjson.Result) ([]StreamTraitMapping, error) { +func convertGjsonToStreamTraitMapping(result gjson.Result) []StreamTraitMapping { var mappings []StreamTraitMapping // Iterate through the array in the result @@ -246,7 +246,7 @@ func convertGjsonToStreamTraitMapping(result gjson.Result) ([]StreamTraitMapping return true // Continue iteration }) - return mappings, nil + return mappings } func (e *LyticsBulkUploader) MakeHTTPRequest(data *HttpRequestData) ([]byte, int, error) { @@ -310,7 +310,7 @@ func (b *LyticsBulkUploader) Upload(asyncDestStruct *common.AsyncDestinationStru var successJobs []int64 destConfigJson := string(destConfig) - streamTraitsMapping, err := convertGjsonToStreamTraitMapping(gjson.Get(destConfigJson, "streamTraitsMapping")) + streamTraitsMapping := convertGjsonToStreamTraitMapping(gjson.Get(destConfigJson, "streamTraitsMapping")) if err != nil { return common.AsyncUploadOutput{ FailedJobIDs: append(asyncDestStruct.FailedJobIDs, asyncDestStruct.ImportingJobIDs...), diff --git a/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lytics_test.go b/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lytics_test.go index 94c886e820..d9f4bc6f10 100644 --- a/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lytics_test.go +++ b/router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lytics_test.go @@ -125,6 +125,10 @@ func TestHttpClientDoSuccess(t *testing.T) { resp, err := mockHttpClient.Do(req) assert.NoError(t, err) assert.Equal(t, expectedResp, resp) + + if resp.Body != nil { + defer resp.Body.Close() + } } func TestPollerPollSuccess(t *testing.T) {