File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " apollo-client-devtools " : patch
3
+ ---
4
+
5
+ Schedule next request to get client data only after the previous one had finished.
Original file line number Diff line number Diff line change @@ -92,20 +92,23 @@ function startRequestInterval(ms = 500) {
92
92
let id : NodeJS . Timeout ;
93
93
94
94
async function getClientData ( ) {
95
- if ( panelWindow ) {
96
- panelWindow . send ( {
97
- type : "update" ,
98
- payload : await rpcClient . request ( "getClientOperations" ) ,
99
- } ) ;
95
+ try {
96
+ if ( panelWindow ) {
97
+ panelWindow . send ( {
98
+ type : "update" ,
99
+ payload : await rpcClient . request ( "getClientOperations" ) ,
100
+ } ) ;
101
+ }
102
+ } finally {
103
+ id = setTimeout ( getClientData , ms ) ;
100
104
}
101
105
}
102
106
103
107
if ( devtoolsMachine . state . value === "connected" ) {
104
108
getClientData ( ) ;
105
- id = setInterval ( ( ) => getClientData ( ) , ms ) ;
106
109
}
107
110
108
- return ( ) => clearInterval ( id ) ;
111
+ return ( ) => clearTimeout ( id ) ;
109
112
}
110
113
111
114
const unsubscribers = new Set < ( ) => void > ( ) ;
You can’t perform that action at this time.
0 commit comments