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 11import { MaybeThenable } from '../../dtos/types' ;
22import { ISegmentsCacheBase } from '../../storages/types' ;
3- import { thenable } from '../../utils/promise/thenable' ;
43
54export function largeSegmentMatcherContext ( largeSegmentName : string , storage : { largeSegments ?: ISegmentsCacheBase } ) {
65
76 return function largeSegmentMatcher ( key : string ) : MaybeThenable < boolean > {
87 const isInLargeSegment = storage . largeSegments ? storage . largeSegments . isInSegment ( largeSegmentName , key ) : false ;
98
10- if ( thenable ( isInLargeSegment ) ) {
11- isInLargeSegment . then ( result => {
12- return result ;
13- } ) ;
14- }
15-
169 return isInLargeSegment ;
1710 } ;
1811}
Original file line number Diff line number Diff line change 11import { MaybeThenable } from '../../dtos/types' ;
22import { ISegmentsCacheBase } from '../../storages/types' ;
3- import { thenable } from '../../utils/promise/thenable' ;
43
54export function segmentMatcherContext ( segmentName : string , storage : { segments : ISegmentsCacheBase } ) {
65
76 return function segmentMatcher ( key : string ) : MaybeThenable < boolean > {
87 const isInSegment = storage . segments . isInSegment ( segmentName , key ) ;
98
10- if ( thenable ( isInSegment ) ) {
11- isInSegment . then ( result => {
12- return result ;
13- } ) ;
14- }
15-
169 return isInSegment ;
1710 } ;
1811}
Original file line number Diff line number Diff line change @@ -266,10 +266,10 @@ export class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
266266 return Promise . reject ( this . redisError ) ;
267267 }
268268
269- const splits : Record < string , ISplit | null > = { } ;
270269 const keys = names . map ( name => this . keys . buildSplitKey ( name ) ) ;
271270 return this . redis . mget ( ...keys )
272271 . then ( splitDefinitions => {
272+ const splits : Record < string , ISplit | null > = { } ;
273273 names . forEach ( ( name , idx ) => {
274274 const split = splitDefinitions [ idx ] ;
275275 splits [ name ] = split && JSON . parse ( split ) ;
You can’t perform that action at this time.
0 commit comments