Skip to content

Commit ebd8c27

Browse files
refactor: remove unused CmabCache.swift and update references to DEFAULT_CMAB_CACHE_TIMEOUT and DEFAULT_CMAB_CACHE_SIZE
1 parent d3e0662 commit ebd8c27

File tree

3 files changed

+5
-56
lines changed

3 files changed

+5
-56
lines changed

OptimizelySwiftSDK.xcodeproj/project.pbxproj

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,22 +2078,6 @@
20782078
98AC984B2DB8FFE0001405DD /* DecisionServiceTests_Holdouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98AC98482DB8FC29001405DD /* DecisionServiceTests_Holdouts.swift */; };
20792079
98AC985E2DBA6721001405DD /* OptimizelyUserContextTests_Decide_With_Holdouts_Reasons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98AC985D2DBA6721001405DD /* OptimizelyUserContextTests_Decide_With_Holdouts_Reasons.swift */; };
20802080
98AC985F2DBA6721001405DD /* OptimizelyUserContextTests_Decide_With_Holdouts_Reasons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98AC985D2DBA6721001405DD /* OptimizelyUserContextTests_Decide_With_Holdouts_Reasons.swift */; };
2081-
98CBECAC2EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2082-
98CBECAD2EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2083-
98CBECAE2EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2084-
98CBECAF2EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2085-
98CBECB02EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2086-
98CBECB12EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2087-
98CBECB22EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2088-
98CBECB32EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2089-
98CBECB42EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2090-
98CBECB52EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2091-
98CBECB62EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2092-
98CBECB72EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2093-
98CBECB82EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2094-
98CBECB92EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2095-
98CBECBA2EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
2096-
98CBECBB2EB3CA6500C06A62 /* CmabCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */; };
20972081
98D5AE842DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D5AE832DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift */; };
20982082
98D5AE852DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D5AE832DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift */; };
20992083
98F28A1D2E01940500A86546 /* Cmab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98F28A1C2E01940500A86546 /* Cmab.swift */; };
@@ -2603,7 +2587,6 @@
26032587
98AC98452DB7B762001405DD /* BucketTests_HoldoutToVariation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BucketTests_HoldoutToVariation.swift; sourceTree = "<group>"; };
26042588
98AC98482DB8FC29001405DD /* DecisionServiceTests_Holdouts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecisionServiceTests_Holdouts.swift; sourceTree = "<group>"; };
26052589
98AC985D2DBA6721001405DD /* OptimizelyUserContextTests_Decide_With_Holdouts_Reasons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptimizelyUserContextTests_Decide_With_Holdouts_Reasons.swift; sourceTree = "<group>"; };
2606-
98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CmabCache.swift; sourceTree = "<group>"; };
26072590
98D5AE832DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptimizelyUserContextTests_Decide_Holdouts.swift; sourceTree = "<group>"; };
26082591
98F28A1C2E01940500A86546 /* Cmab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cmab.swift; sourceTree = "<group>"; };
26092592
98F28A2D2E01968000A86546 /* CmabTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CmabTests.swift; sourceTree = "<group>"; };
@@ -3321,7 +3304,6 @@
33213304
children = (
33223305
98F28A402E02DD6D00A86546 /* CmabClient.swift */,
33233306
98F28A552E0451CC00A86546 /* CmabService.swift */,
3324-
98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */,
33253307
);
33263308
path = CMAB;
33273309
sourceTree = "<group>";
@@ -4339,7 +4321,6 @@
43394321
989428BB2DBFA431008BA1C8 /* MockBucketer.swift in Sources */,
43404322
6E14CDAB2423F9EB00010234 /* MockUrlSession.swift in Sources */,
43414323
6E14CDAA2423F9C300010234 /* SDKVersion.swift in Sources */,
4342-
98CBECB32EB3CA6500C06A62 /* CmabCache.swift in Sources */,
43434324
845945C3287758A100D13E11 /* OdpConfig.swift in Sources */,
43444325
6E14CD832423F9A100010234 /* DataStoreQueueStackImpl.swift in Sources */,
43454326
848617F12863E21200B7F41B /* OdpEventApiManager.swift in Sources */,
@@ -4494,7 +4475,6 @@
44944475
6E424D0926324B620081004A /* FeatureVariable.swift in Sources */,
44954476
6E6419DA2657059700C49555 /* NotificationCenterTests_MultiClients.swift in Sources */,
44964477
6E424D0A26324B620081004A /* Rollout.swift in Sources */,
4497-
98CBECB52EB3CA6500C06A62 /* CmabCache.swift in Sources */,
44984478
6E2D5DAE26338CA00002077F /* AtomicDictionaryTests.swift in Sources */,
44994479
6E424D0B26324B620081004A /* Variation.swift in Sources */,
45004480
6E424D0C26324B620081004A /* TrafficAllocation.swift in Sources */,
@@ -4626,7 +4606,6 @@
46264606
6EF8DE1B24BD1BB2008B9488 /* OptimizelyDecideOption.swift in Sources */,
46274607
980CC90D2D833F2800E07D24 /* ExperimentCore.swift in Sources */,
46284608
6E75173722C520D400B2B157 /* MurmurHash3.swift in Sources */,
4629-
98CBECB42EB3CA6500C06A62 /* CmabCache.swift in Sources */,
46304609
6E7517F922C520D400B2B157 /* DataStoreUserDefaults.swift in Sources */,
46314610
C78CAF592445AD8D009FE876 /* OptimizelyJSON.swift in Sources */,
46324611
848617C92863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,
@@ -4669,7 +4648,6 @@
46694648
989428B32DBFA431008BA1C8 /* MockBucketer.swift in Sources */,
46704649
6E75170222C520D400B2B157 /* OptimizelyLogLevel.swift in Sources */,
46714650
6E7516BA22C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
4672-
98CBECB02EB3CA6500C06A62 /* CmabCache.swift in Sources */,
46734651
845945C7287758A300D13E11 /* OdpConfig.swift in Sources */,
46744652
6E75175622C520D400B2B157 /* LogMessage.swift in Sources */,
46754653
848617F62863E21200B7F41B /* OdpEventApiManager.swift in Sources */,
@@ -4888,7 +4866,6 @@
48884866
6E75175E22C520D400B2B157 /* AtomicProperty.swift in Sources */,
48894867
6E9B11DE22C548A200C22D81 /* OptimizelyClientTests_Others.swift in Sources */,
48904868
C78CAF7424482C86009FE876 /* OptimizelyClientTests_OptimizelyJSON.swift in Sources */,
4891-
98CBECBA2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
48924869
6EC6DD3724ABF6990017D296 /* OptimizelyClient+Decide.swift in Sources */,
48934870
6E7516E622C520D400B2B157 /* OPTEventDispatcher.swift in Sources */,
48944871
98F28A612E0451CC00A86546 /* CmabService.swift in Sources */,
@@ -4948,7 +4925,6 @@
49484925
6E75173D22C520D400B2B157 /* MurmurHash3.swift in Sources */,
49494926
6E7516E922C520D400B2B157 /* OPTEventDispatcher.swift in Sources */,
49504927
6E7518A722C520D400B2B157 /* FeatureFlag.swift in Sources */,
4951-
98CBECB92EB3CA6500C06A62 /* CmabCache.swift in Sources */,
49524928
6E75187722C520D400B2B157 /* Variation.swift in Sources */,
49534929
6E7517F322C520D400B2B157 /* DataStoreMemory.swift in Sources */,
49544930
6E7518FB22C520D500B2B157 /* UserAttribute.swift in Sources */,
@@ -5119,7 +5095,6 @@
51195095
84E2E94F2852A378001114AB /* VuidManager.swift in Sources */,
51205096
6E75176322C520D400B2B157 /* AtomicProperty.swift in Sources */,
51215097
6E9B117722C5487100C22D81 /* BatchEventBuilderTests_EventTags.swift in Sources */,
5122-
98CBECB62EB3CA6500C06A62 /* CmabCache.swift in Sources */,
51235098
6E7517DD22C520D400B2B157 /* DefaultNotificationCenter.swift in Sources */,
51245099
6E9B116622C5487100C22D81 /* DecisionServiceTests_UserProfiles.swift in Sources */,
51255100
6E34A6202319EBB800BAE302 /* Notifications.swift in Sources */,
@@ -5277,7 +5252,6 @@
52775252
6E9B11B822C5489600C22D81 /* OTUtils.swift in Sources */,
52785253
98AC97F42DAE9685001405DD /* HoldoutConfigTests.swift in Sources */,
52795254
6E9B119022C5488300C22D81 /* AttributeValueTests.swift in Sources */,
5280-
98CBECBB2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
52815255
6E994B4025A3E6EA00999262 /* DecisionResponse.swift in Sources */,
52825256
84E2E9802855875E001114AB /* OdpEventManager.swift in Sources */,
52835257
6E75175822C520D400B2B157 /* LogMessage.swift in Sources */,
@@ -5416,7 +5390,6 @@
54165390
6E4544AF270E67C800F2CEBC /* NetworkReachability.swift in Sources */,
54175391
6E75177522C520D400B2B157 /* SDKVersion.swift in Sources */,
54185392
848617CD2863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,
5419-
98CBECAE2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
54205393
6E75180722C520D400B2B157 /* DataStoreFile.swift in Sources */,
54215394
8486181D286D188B00B7F41B /* OdpEventApiManagerTests.swift in Sources */,
54225395
6E75183722C520D400B2B157 /* EventForDispatch.swift in Sources */,
@@ -5599,7 +5572,6 @@
55995572
6E424C04263228FD0081004A /* AtomicDictionary.swift in Sources */,
56005573
6E75189922C520D400B2B157 /* Experiment.swift in Sources */,
56015574
6E75178322C520D400B2B157 /* ArrayEventForDispatch+Extension.swift in Sources */,
5602-
98CBECB12EB3CA6500C06A62 /* CmabCache.swift in Sources */,
56035575
6E424BE5263228E90081004A /* AtomicArray.swift in Sources */,
56045576
6E7518A522C520D400B2B157 /* FeatureFlag.swift in Sources */,
56055577
);
@@ -5666,7 +5638,6 @@
56665638
6E4544B4270E67C800F2CEBC /* NetworkReachability.swift in Sources */,
56675639
6E75184622C520D400B2B157 /* Event.swift in Sources */,
56685640
6E7517CE22C520D400B2B157 /* DefaultBucketer.swift in Sources */,
5669-
98CBECB82EB3CA6500C06A62 /* CmabCache.swift in Sources */,
56705641
6E75180A22C520D400B2B157 /* DataStoreFile.swift in Sources */,
56715642
6E7516B822C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
56725643
6E7517C222C520D400B2B157 /* DefaultDatafileHandler.swift in Sources */,
@@ -5776,7 +5747,6 @@
57765747
6E4544B9270E67C800F2CEBC /* NetworkReachability.swift in Sources */,
57775748
6E75184B22C520D400B2B157 /* Event.swift in Sources */,
57785749
6E7517D322C520D400B2B157 /* DefaultBucketer.swift in Sources */,
5779-
98CBECAD2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
57805750
6E75180F22C520D400B2B157 /* DataStoreFile.swift in Sources */,
57815751
6E7516BD22C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
57825752
6E7517C722C520D400B2B157 /* DefaultDatafileHandler.swift in Sources */,
@@ -5891,7 +5861,6 @@
58915861
6EF8DE1A24BD1BB2008B9488 /* OptimizelyDecideOption.swift in Sources */,
58925862
980CC90B2D833F2800E07D24 /* ExperimentCore.swift in Sources */,
58935863
6E75186422C520D400B2B157 /* Rollout.swift in Sources */,
5894-
98CBECAF2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
58955864
6E75179622C520D400B2B157 /* DataStoreQueueStackImpl+Extension.swift in Sources */,
58965865
C78CAF582445AD8D009FE876 /* OptimizelyJSON.swift in Sources */,
58975866
848617C82863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,
@@ -5934,7 +5903,6 @@
59345903
989428BE2DBFA431008BA1C8 /* MockBucketer.swift in Sources */,
59355904
6E7516FC22C520D400B2B157 /* OptimizelyLogLevel.swift in Sources */,
59365905
6E7516B422C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
5937-
98CBECAC2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
59385906
845945C02877589F00D13E11 /* OdpConfig.swift in Sources */,
59395907
6E75175022C520D400B2B157 /* LogMessage.swift in Sources */,
59405908
848617EE2863E21200B7F41B /* OdpEventApiManager.swift in Sources */,
@@ -6121,7 +6089,6 @@
61216089
75C71A3B25E454460084187E /* ArrayEventForDispatch+Extension.swift in Sources */,
61226090
75C71A3C25E454460084187E /* OptimizelyClient+Extension.swift in Sources */,
61236091
75C71A3D25E454460084187E /* DataStoreQueueStackImpl+Extension.swift in Sources */,
6124-
98CBECB72EB3CA6500C06A62 /* CmabCache.swift in Sources */,
61256092
845945BF2877589F00D13E11 /* OdpConfig.swift in Sources */,
61266093
75C71A3E25E454460084187E /* Array+Extension.swift in Sources */,
61276094
75C71A3F25E454460084187E /* Constants.swift in Sources */,
@@ -6205,7 +6172,6 @@
62056172
6EF8DE1C24BD1BB2008B9488 /* OptimizelyDecideOption.swift in Sources */,
62066173
980CC9132D833F2800E07D24 /* ExperimentCore.swift in Sources */,
62076174
BD6485642491474500F30986 /* Rollout.swift in Sources */,
6208-
98CBECB22EB3CA6500C06A62 /* CmabCache.swift in Sources */,
62096175
BD6485652491474500F30986 /* DataStoreQueueStackImpl+Extension.swift in Sources */,
62106176
BD6485662491474500F30986 /* OptimizelyJSON.swift in Sources */,
62116177
848617CA2863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,

Sources/CMAB/CmabCache.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.

Sources/CMAB/CmabService.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ protocol CmabService {
4141
completion: @escaping CmabDecisionCompletionHandler)
4242
}
4343

44+
let DEFAULT_CMAB_CACHE_TIMEOUT = 30 * 60 // 30 minutes
45+
let DEFAULT_CMAB_CACHE_SIZE = 100
46+
47+
typealias CmabCache = LruCache<String, CmabCacheValue>
48+
4449
class DefaultCmabService: CmabService {
4550
typealias UserAttributes = [String : Any?]
4651

0 commit comments

Comments
 (0)