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 {
9393 */
9494 constructor ( options : Model . IOptions ) {
9595 super ( ) ;
96- this . _poll = new Poll < Private . IMetricRequestResult | null > ( {
96+ this . _poll = new Poll < Private . IMetricRequestResult > ( {
9797 factory : ( ) => Private . factory ( ) ,
9898 frequency : {
9999 interval : options . refreshRate ,
@@ -216,7 +216,7 @@ export namespace MemoryUsage {
216216 private _currentMemory = 0 ;
217217 private _memoryLimit : number | null = null ;
218218 private _metricsAvailable = false ;
219- private _poll : Poll < Private . IMetricRequestResult | null > ;
219+ private _poll : Poll < Private . IMetricRequestResult > ;
220220 private _units : MemoryUnit = 'B' ;
221221 private _warn = false ;
222222 }
@@ -328,18 +328,14 @@ namespace Private {
328328 /**
329329 * Make a request to the backend.
330330 */
331- export async function factory ( ) : Promise < IMetricRequestResult | null > {
331+ export async function factory ( ) : Promise < IMetricRequestResult > {
332332 const request = ServerConnection . makeRequest (
333333 METRIC_URL ,
334334 { } ,
335335 SERVER_CONNECTION_SETTINGS
336336 ) ;
337337 const response = await request ;
338338
339- if ( response . ok ) {
340- return await response . json ( ) ;
341- }
342-
343- return null ;
339+ return await response . json ( ) ;
344340 }
345341}
You can’t perform that action at this time.
0 commit comments