File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ export class Session {
371
371
}
372
372
}
373
373
} else {
374
+ let ordersOfMagnitude = 0 ;
374
375
while ( true ) {
375
376
const followingTimePoint = this . timeCursor . offsetByFemtos ( this . _forwardTimeStep ) ;
376
377
const response = await this . connection . queryInterval ( {
@@ -382,12 +383,15 @@ export class Session {
382
383
item_values_encoding : null ,
383
384
diagnostics : false
384
385
} ) ;
385
- if ( response . samples . length === 1 ) {
386
- this . _forwardTimeStep = this . _forwardTimeStep * 2n ;
387
- continue ;
386
+ if ( response . samples . length > 1 ) {
387
+ this . timeCursor = TimePoint . fromCXXRTL ( response . samples . at ( 1 ) ! . time ) ;
388
+ break ;
389
+ } else if ( ordersOfMagnitude < 30 /* femto -> peta */ ) {
390
+ ordersOfMagnitude += 1 ;
391
+ this . _forwardTimeStep = this . _forwardTimeStep * 10n ;
392
+ } else {
393
+ throw new RangeError ( 'Could not find a sample to step forward to' ) ;
388
394
}
389
- this . timeCursor = TimePoint . fromCXXRTL ( response . samples . at ( 1 ) ! . time ) ;
390
- break ;
391
395
}
392
396
}
393
397
return this . timeCursor ;
You can’t perform that action at this time.
0 commit comments