kloudlite / web

Kloudlite Web
http://kloudlite.io
GNU Affero General Public License v3.0
2 stars 1 forks source link

WEB: Cluster status for all dependent resources is showing offline sometime #288

Closed nxtCoder19 closed 2 months ago

nxtCoder19 commented 2 months ago

Issue fixed : Now status is showing as per expected

Summary by Sourcery

Fix the cluster status display issue by implementing a polling mechanism to update the status at regular intervals, ensuring accurate online status for clusters.

Bug Fixes:

Enhancements:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request addresses an issue with cluster status display for dependent resources. The changes implement a more efficient and reliable way of fetching and updating cluster status information, removing redundant state management, and improving the overall performance of the application.

File-Level Changes

Change Details Files
Implemented periodic cluster status updates
  • Added useEffect hook to set up an interval for calling listCluster every 30 seconds
  • Removed clearInterval on component unmount to prevent memory leaks
src/apps/console/hooks/use-cluster-status-v2.tsx
Optimized cluster status checking in resource list views
  • Removed redundant state management for cluster online status
  • Replaced clusterOnlineStatus state with direct calls to findClusterStatus function
  • Updated isClusterOnline variable to use clusters object directly
src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx
src/apps/console/routes/_main+/$account+/managed-services/backend-services-resources-V2.tsx
Code cleanup and minor improvements
  • Added missing comma at the end of some array and object literals
  • Removed commented-out code related to the old cluster status management
  • Added a console.log statement for debugging purposes (may need to be removed later)
src/apps/console/hooks/use-cluster-status-v2.tsx
src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx
src/apps/console/routes/_main+/$account+/managed-services/backend-services-resources-V2.tsx

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.