File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
packages/labextension/src Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export namespace MemoryUsage {
93
93
*/
94
94
constructor ( options : Model . IOptions ) {
95
95
super ( ) ;
96
- this . _poll = new Poll < Private . IMetricRequestResult | null > ( {
96
+ this . _poll = new Poll < Private . IMetricRequestResult > ( {
97
97
factory : ( ) => Private . factory ( ) ,
98
98
frequency : {
99
99
interval : options . refreshRate ,
@@ -216,7 +216,7 @@ export namespace MemoryUsage {
216
216
private _currentMemory = 0 ;
217
217
private _memoryLimit : number | null = null ;
218
218
private _metricsAvailable = false ;
219
- private _poll : Poll < Private . IMetricRequestResult | null > ;
219
+ private _poll : Poll < Private . IMetricRequestResult > ;
220
220
private _units : MemoryUnit = 'B' ;
221
221
private _warn = false ;
222
222
}
@@ -328,18 +328,14 @@ namespace Private {
328
328
/**
329
329
* Make a request to the backend.
330
330
*/
331
- export async function factory ( ) : Promise < IMetricRequestResult | null > {
331
+ export async function factory ( ) : Promise < IMetricRequestResult > {
332
332
const request = ServerConnection . makeRequest (
333
333
METRIC_URL ,
334
334
{ } ,
335
335
SERVER_CONNECTION_SETTINGS
336
336
) ;
337
337
const response = await request ;
338
338
339
- if ( response . ok ) {
340
- return await response . json ( ) ;
341
- }
342
-
343
- return null ;
339
+ return await response . json ( ) ;
344
340
}
345
341
}
You can’t perform that action at this time.
0 commit comments