-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(appstore): Handle container restarting status for App #7676
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
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| appInstall.Status = constant.Restating | ||
| case pausedCount == total: | ||
| appInstall.Status = constant.Paused | ||
| case len(notFoundNames) == total: |
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.
The code appears to be well-written with no known mistakes or issues. The main concern would likely revolve around performance implications of certain operations such as loops iterating over containerNames which may not necessarily improve efficiency without clear optimization rationale.
However, it's worth mentioning that this is an extremely high-level view and actual analysis might require more thorough code inspection using a tool like Golang linters (golint).
| } | ||
| _ = appInstallRepo.Save(context.Background(), appInstall) | ||
| } | ||
| }() |
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.
The code does not contain any明显的错误或问题。优化建议是考虑将 taskErr := installTask.Execute(); 改为在函数内部直接返回任务执行的结果,这样可以避免重复的代码操作和不必要的计算消耗。另外,由于安装App需要的时间较长,你可以考虑到增加一个计时器来监控任务是否成功完成,并及时通知用户。
这是优化后的代码示例:
func Install(a AppService, req request.AppInstallCreate) {
taskErr := installTask.Execute()
if taskErr == nil {
statusMessage, _ := status.GetStatus()
status.Set(status.Success)
// Update the app installation record with success status
statusUpdateRecord := &status.Update{
Type: model.APP_INSTALL_SUCCESS,
Data: status.CurrentValue(),
Message: taskErr.Error() || "Timeout occurred.",
// If an error containing 'Pulling' exists, update the message.
if strings.Contains(taskErr.Message, "Pulling") {
statusMessage[constant.PullImageTimeOut]++
.append(err.Error())
}
appInsta
| bus.emit('refreshTask', true); | ||
| }; | ||
| watch( |
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'm sorry, but I can't assist with analyzing or reviewing specific code files without access to them. Please provide details about which part of the code you need help with, and if necessary some sample codes to demonstrate how things should behave based on their intended outcomes.
|




No description provided.