Skip to content

Commit 53b2073

Browse files
Rename method
1 parent 22cee22 commit 53b2073

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/storages/KeyBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class KeyBuilder {
4141
return `${this.prefix}.rbsegment.${splitName}`;
4242
}
4343

44-
buildRBSegmentTillKey() {
44+
buildRBSegmentsTillKey() {
4545
return `${this.prefix}.rbsegments.till`;
4646
}
4747

src/storages/__tests__/testUtils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ISplit } from '../../dtos/types';
1+
import { IRBSegment, ISplit } from '../../dtos/types';
22
import { IStorageSync, IStorageAsync, IImpressionsCacheSync, IEventsCacheSync } from '../types';
33

44
// Assert that instances created by storage factories have the expected interface
@@ -45,3 +45,9 @@ export const featureFlagTwo: ISplit = { name: 'ff_two', sets: ['t','w','o'] };
4545
export const featureFlagThree: ISplit = { name: 'ff_three', sets: ['t','h','r','e'] };
4646
//@ts-ignore
4747
export const featureFlagWithoutFS: ISplit = { name: 'ff_four' };
48+
49+
// Rule-based segments
50+
//@ts-ignore
51+
export const rbSegment: IRBSegment = { name: 'rb_segment', conditions: [{ matcherGroup: { matchers: [{ matcherType: 'EQUAL_TO', unaryNumericMatcherData: { value: 10 } }] } }] };
52+
//@ts-ignore
53+
export const rbSegmentWithInSegmentMatcher: IRBSegment = { name: 'rb_segment_with_in_segment_matcher', conditions: [{ matcherGroup: { matchers: [{ matcherType: 'IN_SEGMENT', userDefinedSegmentMatcherData: { segmentName: 'employees' } }] } }] };

src/storages/inRedis/RBSegmentsCacheInRedis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ export class RBSegmentsCacheInRedis implements IRBSegmentsCacheAsync {
5555
}
5656

5757
setChangeNumber(changeNumber: number) {
58-
return this.redis.set(this.keys.buildRBSegmentTillKey(), changeNumber + '').then(
58+
return this.redis.set(this.keys.buildRBSegmentsTillKey(), changeNumber + '').then(
5959
status => status === 'OK'
6060
);
6161
}
6262

6363
getChangeNumber(): Promise<number> {
64-
return this.redis.get(this.keys.buildRBSegmentTillKey()).then((value: string | null) => {
64+
return this.redis.get(this.keys.buildRBSegmentsTillKey()).then((value: string | null) => {
6565
const i = parseInt(value as string, 10);
6666

6767
return isNaNNumber(i) ? -1 : i;

src/storages/pluggable/RBSegmentsCachePluggable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export class RBSegmentsCachePluggable implements IRBSegmentsCacheAsync {
5454
}
5555

5656
setChangeNumber(changeNumber: number) {
57-
return this.wrapper.set(this.keys.buildRBSegmentTillKey(), changeNumber + '');
57+
return this.wrapper.set(this.keys.buildRBSegmentsTillKey(), changeNumber + '');
5858
}
5959

6060
getChangeNumber(): Promise<number> {
61-
return this.wrapper.get(this.keys.buildRBSegmentTillKey()).then((value) => {
61+
return this.wrapper.get(this.keys.buildRBSegmentsTillKey()).then((value) => {
6262
const i = parseInt(value as string, 10);
6363

6464
return isNaNNumber(i) ? -1 : i;

0 commit comments

Comments
 (0)