-
Notifications
You must be signed in to change notification settings - Fork 8
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: improve performance of checking for offline deployments #1718
refactor: improve performance of checking for offline deployments #1718
Conversation
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.
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 think we need this function anymore.
tfgrid-sdk-ts/packages/playground/src/utils/get_nodes.ts
Lines 32 to 58 in 1b89a60
export async function getAllNodes(grid: GridClient | null, options?: NodeFilters): Promise<NodeInfo[] | number[]> { | |
const isFlat = options?.flat || false; | |
const isLastPage = requestPageNumber.value === 0; | |
if (isLastPage) { | |
if (isFlat) { | |
return offlineNodes.value.map(node => node.nodeId); | |
} | |
return offlineNodes.value; | |
} else { | |
const offNodes: NodeInfo[] = await grid!.nodes.filter({ | |
...options, | |
// status: NodeStatus.down, | |
page: requestPageNumber.value, | |
}); | |
if (offNodes.length) { | |
offlineNodes.value.push(...offNodes); | |
requestPageNumber.value += 1; | |
} else { | |
// needs to be last page. | |
requestPageNumber.value = 0; | |
} | |
} | |
return getAllNodes(grid, options); | |
} |
Great fix ya @MohamedElmdary! |
Description
checking for offline deployments was loading all nodes on grid
Changes
Load only nodes which used in my contracts
Related Issues
Checklist