-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor state loader functions get all node deployments at once #1298
base: development
Are you sure you want to change the base?
refactor state loader functions get all node deployments at once #1298
Conversation
if len(strings.TrimSpace(dl.Metadata)) == 0 { | ||
return zosTypes.Workload{}, zosTypes.Deployment{}, errors.Wrapf(err, "contract %d doesn't have metadata", contractID) | ||
} | ||
return zosTypes.Workload{}, zosTypes.Deployment{}, errors.Wrapf(err, "contract %d doesn't have metadata", dl.ContractID) |
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.
why checking metadata twice?
if err != nil { | ||
return zosTypes.Workload{}, zosTypes.Deployment{}, errors.Wrapf(err, "could not get node client: %d", nodeID) | ||
} | ||
nodeClient, err := st.NcPool.GetNodeClient(sub, nodeID) |
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.
why getting node client before checking deployments condition
if err != nil { | ||
return zosTypes.Workload{}, zosTypes.Deployment{}, errors.Wrapf(err, "could not get deployment %d from node %d", contractID, nodeID) | ||
return zosTypes.Workload{}, zosTypes.Deployment{}, errors.Wrapf(err, "could not get contract %d from node %d", dl.ContractID, nodeID) |
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.
what is the error checked?
Description
the state tries to load every deployments one by one from the nodes to be able to get a workload
Changes
I used the
nodeClient.DeploymentList
to load all deployments at once instead of doing multible rmb requests.Related Issues
state.LoadNetworkFromGrid
#856Checklist