-
Notifications
You must be signed in to change notification settings - Fork 162
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
Schedule next request to get data after previous request finishes #1352
Conversation
#298 Bundle Size — 889.98KiB (0%).Warning Bundle contains 31 duplicate packages – View duplicate packages Bundle metrics
|
Current #298 |
Baseline #294 |
|
---|---|---|
Initial JS | 852.58KiB |
852.58KiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 0% |
86.91% |
Chunks | 5 |
5 |
Assets | 12 |
12 |
Modules | 680 |
680 |
Duplicate Modules | 35 |
35 |
Duplicate Code | 4.72% |
4.72% |
Packages | 96 |
96 |
Duplicate Packages | 30 |
30 |
Bundle size by type no changes
Current #298 |
Baseline #294 |
|
---|---|---|
JS | 852.58KiB |
852.58KiB |
IMG | 35.85KiB |
35.85KiB |
HTML | 810B |
810B |
Other | 778B |
778B |
Bundle analysis report Branch jerel/request-interval Project dashboard
src/extension/devtools/devtools.ts
Outdated
@@ -98,14 +98,15 @@ function startRequestInterval(ms = 500) { | |||
payload: await rpcClient.request("getClientOperations"), | |||
}); | |||
} | |||
|
|||
id = setTimeout(() => getClientData(), ms); |
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.
id = setTimeout(() => getClientData(), ms); | |
id = setTimeout(getClientData, ms); |
I think we don't need the function definition here
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.
Also, should we wrap the whole block in try..finally to ensure an exception doesn't break the loop?
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.
Thats a good idea!
Small optimization to only trigger a new fetch of data after the previous completes. In case we are dealing with large payloads that take a significant amount of time to copy over, this prevents us from potentially overlapping the next request before the previous finishes.