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

[perf-improv] No need to "await", save up extra API call(s) #1014

Open
SanjalKatiyar opened this issue Aug 30, 2023 · 1 comment
Open

[perf-improv] No need to "await", save up extra API call(s) #1014

SanjalKatiyar opened this issue Aug 30, 2023 · 1 comment

Comments

@SanjalKatiyar
Copy link
Collaborator

No need to "await" here: https://github.com/red-hat-storage/odf-console/blob/master/packages/mco/features.ts#L130
If we do, "intervalId" (here: https://github.com/red-hat-storage/odf-console/blob/master/packages/mco/features.ts#L131) will not be set until above "await" resolves, which will eventually lead to "featureDetector" be executed once again.
Without "await", "intervalId" will be set immediately and as soon as "featureDetector" gets resolved for the first time it will clear the interval as well (preventing callback in "setInterval" from being executed).

@SanjalKatiyar
Copy link
Collaborator Author

cc @GowthamShanmugam (fyi)

@SanjalKatiyar SanjalKatiyar changed the title [perf-improv] no need to "await", save up extra API call(s) [perf-improv] No need to "await", save up extra API call(s) Feb 26, 2024
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

No branches or pull requests

1 participant