Reduce redundant metadata API requests in dashboard pages#250
Reduce redundant metadata API requests in dashboard pages#250dolliecoder wants to merge 1 commit into
Conversation
|
[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 |
|
Welcome @dolliecoder! It looks like this is your first PR to volcano-sh/dashboard 🎉 |
There was a problem hiding this comment.
Code Review
This pull request refactors the data fetching logic in the Jobs, PodGroups, and Pods components by moving metadata fetching (namespaces and queues) into separate useEffect hooks that run only on mount. Feedback was provided to include cleanup mechanisms in these new hooks to prevent potential state updates on unmounted components and to consider the impact of moving these fetches out of the manual refresh cycle.
Signed-off-by: dolliecoder <dollychahar27@gmail.com>
7413e7b to
a97f5f5
Compare
Summary
This PR reduces redundant metadata API requests across the Jobs, Pods, and PodGroups pages.
Previously, metadata fetches such as
fetchAllNamespaces()andfetchAllQueues()were coupled with data-fetch effects that depended on dynamic query callbacks (fetchJobs,fetchPods,fetchPodGroups). Since these callbacks are recreated when search, filters, or pagination state changes, the metadata endpoints were being unnecessarily re-requested multiple times.Changes
Separated metadata fetches into dedicated mount-only
useEffecthooksPreserved existing dynamic data-fetch behavior for jobs, pods, and podgroups
Reduced unnecessary requests to:
/api/namespaces/api/all-queuesFiles Updated
frontend/src/components/jobs/Jobs.jsxfrontend/src/components/pods/Pods.jsxfrontend/src/components/podgroups/PodGroups.jsxResult
Testing
Verified that: