File tree Expand file tree Collapse file tree 3 files changed +1
-15
lines changed Expand file tree Collapse file tree 3 files changed +1
-15
lines changed Original file line number Diff line number Diff line change 1
1
import { MaybeThenable } from '../../dtos/types' ;
2
2
import { ISegmentsCacheBase } from '../../storages/types' ;
3
- import { thenable } from '../../utils/promise/thenable' ;
4
3
5
4
export function largeSegmentMatcherContext ( largeSegmentName : string , storage : { largeSegments ?: ISegmentsCacheBase } ) {
6
5
7
6
return function largeSegmentMatcher ( key : string ) : MaybeThenable < boolean > {
8
7
const isInLargeSegment = storage . largeSegments ? storage . largeSegments . isInSegment ( largeSegmentName , key ) : false ;
9
8
10
- if ( thenable ( isInLargeSegment ) ) {
11
- isInLargeSegment . then ( result => {
12
- return result ;
13
- } ) ;
14
- }
15
-
16
9
return isInLargeSegment ;
17
10
} ;
18
11
}
Original file line number Diff line number Diff line change 1
1
import { MaybeThenable } from '../../dtos/types' ;
2
2
import { ISegmentsCacheBase } from '../../storages/types' ;
3
- import { thenable } from '../../utils/promise/thenable' ;
4
3
5
4
export function segmentMatcherContext ( segmentName : string , storage : { segments : ISegmentsCacheBase } ) {
6
5
7
6
return function segmentMatcher ( key : string ) : MaybeThenable < boolean > {
8
7
const isInSegment = storage . segments . isInSegment ( segmentName , key ) ;
9
8
10
- if ( thenable ( isInSegment ) ) {
11
- isInSegment . then ( result => {
12
- return result ;
13
- } ) ;
14
- }
15
-
16
9
return isInSegment ;
17
10
} ;
18
11
}
Original file line number Diff line number Diff line change @@ -266,10 +266,10 @@ export class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
266
266
return Promise . reject ( this . redisError ) ;
267
267
}
268
268
269
- const splits : Record < string , ISplit | null > = { } ;
270
269
const keys = names . map ( name => this . keys . buildSplitKey ( name ) ) ;
271
270
return this . redis . mget ( ...keys )
272
271
. then ( splitDefinitions => {
272
+ const splits : Record < string , ISplit | null > = { } ;
273
273
names . forEach ( ( name , idx ) => {
274
274
const split = splitDefinitions [ idx ] ;
275
275
splits [ name ] = split && JSON . parse ( split ) ;
You can’t perform that action at this time.
0 commit comments