File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " bugfix" ,
3
+ "category" : " EndpointCache" ,
4
+ "description" : " Only delete endpoint which has expired in EndpointCache"
5
+ }
Original file line number Diff line number Diff line change @@ -29,13 +29,16 @@ var EndpointCache = /** @class */ (function () {
29
29
var now = Date . now ( ) ;
30
30
var records = this . cache . get ( keyString ) ;
31
31
if ( records ) {
32
- for ( var i = 0 ; i < records . length ; i ++ ) {
32
+ for ( var i = records . length - 1 ; i >= 0 ; i -- ) {
33
33
var record = records [ i ] ;
34
34
if ( record . Expire < now ) {
35
- this . cache . remove ( keyString ) ;
36
- return undefined ;
35
+ records . splice ( i , 1 ) ;
37
36
}
38
37
}
38
+ if ( records . length === 0 ) {
39
+ this . cache . remove ( keyString ) ;
40
+ return undefined ;
41
+ }
39
42
}
40
43
return records ;
41
44
} ;
You can’t perform that action at this time.
0 commit comments