@@ -102,24 +102,24 @@ export async function tryFastPathGet(opts: FastPathOptions): Promise<FastPathRes
102102 try {
103103 const resolved = await opts . resolve ( persistedPath ) ;
104104 if ( resolved ) {
105- if ( isGlobalScope && cacheStopWatch ) {
106- sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch . elapsedTime , {
105+ if ( isGlobalScope ) {
106+ sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch ! . elapsedTime , {
107107 managerLabel : opts . label ,
108108 result : 'hit' ,
109109 } ) ;
110110 }
111111 return { env : resolved } ;
112112 }
113113 // Cached path found but resolve returned undefined (e.g., Python was uninstalled)
114- if ( isGlobalScope && cacheStopWatch ) {
115- sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch . elapsedTime , {
114+ if ( isGlobalScope ) {
115+ sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch ! . elapsedTime , {
116116 managerLabel : opts . label ,
117117 result : 'stale' ,
118118 } ) ;
119119 }
120120 } catch ( err ) {
121- if ( isGlobalScope && cacheStopWatch ) {
122- sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch . elapsedTime , {
121+ if ( isGlobalScope ) {
122+ sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch ! . elapsedTime , {
123123 managerLabel : opts . label ,
124124 result : 'stale' ,
125125 } ) ;
@@ -130,8 +130,8 @@ export async function tryFastPathGet(opts: FastPathOptions): Promise<FastPathRes
130130 ) ;
131131 }
132132 } else {
133- if ( isGlobalScope && cacheStopWatch ) {
134- sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch . elapsedTime , {
133+ if ( isGlobalScope ) {
134+ sendTelemetryEvent ( EventNames . GLOBAL_ENV_CACHE , cacheStopWatch ! . elapsedTime , {
135135 managerLabel : opts . label ,
136136 result : 'miss' ,
137137 } ) ;
0 commit comments