File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/sdk/server-ai/src Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -151,10 +151,6 @@ export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
151151 // Wait for metrics to be available
152152 const metrics = await metricsExtractor ( stream ) ;
153153
154- // Track final duration
155- const duration = Date . now ( ) - startTime ;
156- this . trackDuration ( duration ) ;
157-
158154 // Track success/error based on metrics
159155 if ( metrics . success ) {
160156 this . trackSuccess ( ) ;
@@ -168,8 +164,10 @@ export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
168164 }
169165 } catch ( error ) {
170166 // If metrics extraction fails, track error
171- // but don't throw - stream consumption should not be affected
172167 this . trackError ( ) ;
168+ } finally {
169+ // Track duration regardless of success/error
170+ this . trackDuration ( Date . now ( ) - startTime ) ;
173171 }
174172 }
175173
You can’t perform that action at this time.
0 commit comments