Skip to content
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

[feat]tools-v2: optimize bs delete volume xxx and define result code … #2777

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

baytan0720
Copy link
Member

…as constant

What problem does this PR solve?

Issue Number: #xxx

Problem Summary:

optimize use sync.WaitGroup, define result status code as constant

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@baytan0720
Copy link
Member Author

cicheck

if err.TypeCode() != cmderror.CODE_SUCCESS {
item["Result"] = "fail"
item["Result"] = cobrautil.ROW_VALUE_FAILED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Result" Please define it as a constant

}
item["Result"] = cobrautil.ROW_VALUE_SUCCESS
rCmd.TableNew.Append([]string{item["User"], item["Src"], item["UUID"], item["File"], item["Result"]})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define it as a constant

item["Result"] = "success"
payload := map[string]any{}
if err := json.Unmarshal([]byte(result), &payload); err != nil {
item["Result"] = cobrautil.ROW_VALUE_FAILED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

item["Result"] = cobrautil.ROW_VALUE_FAILED
} else {
if payload[cobrautil.ResultCode] != cobrautil.ResultSuccess {
item["Result"] = cobrautil.ROW_VALUE_FAILED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

…as constant

Signed-off-by: baytan0720 <baytan2@hotmail.com>
@baytan0720
Copy link
Member Author

cicheck

2 similar comments
@baytan0720
Copy link
Member Author

cicheck

@Cyber-SiKu
Copy link
Contributor

cicheck

@Cyber-SiKu Cyber-SiKu merged commit 10a5747 into opencurve:master Oct 8, 2023
4 checks passed
@baytan0720 baytan0720 deleted the utils branch November 3, 2023 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants