-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bpmilestone4 #16
base: feature/multipleSources
Are you sure you want to change the base?
Bpmilestone4 #16
Conversation
@@ -384,7 +386,7 @@ func (e *exportPullOptions) IlmtPullBase(s *datactlapi.Source, ctx context.Conte | |||
return p | |||
}) | |||
|
|||
return productCount, productUsageResponseStr, nil | |||
return productCount, EMPTY, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a need to keep 3 return values here when we are only using only the error object/response in the caller.
response := i.ilmt.FetchUsageData(ctx, dateRangeOptions, selectedDate) | ||
check(err) | ||
|
||
responseFile := fmt.Sprintf(RESPONSEFILE, archFileTempDir, selDate) | ||
manifestFile := fmt.Sprintf(MANIFESTFILE, archFileTempDir) | ||
manifestFileContent := MANIFESTFILECONTENT | ||
err = ioutil.WriteFile(responseFile, response, 0644) | ||
check(err) | ||
err = ioutil.WriteFile(manifestFile, []byte(manifestFileContent), 0644) | ||
check(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling just check(err) [here, and in many other places] is just catching err and panicking. May be we should also log appropriate error messages for each failing scenario?
log.Fatal(err.Error()) | ||
return -1, EMPTY, err | ||
} | ||
func (ilmtC *ilmtClient) FetchUsageData(ctx context.Context, dateRange DateRange, selectedDate time.Time) []byte { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can further modularize this FetchUsageData
code by moving the processing logic (2 big FOR loops) into a separate util function?
Steps:
|
PR raised