Skip to content

Commit e2055a0

Browse files
chore: add CmabCache.swift and update references in project files
1 parent 81a776c commit e2055a0

File tree

10 files changed

+292
-15
lines changed

10 files changed

+292
-15
lines changed

OptimizelySwiftSDK.xcodeproj/project.pbxproj

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,22 @@
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 */; };
20812097
98D5AE842DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D5AE832DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift */; };
20822098
98D5AE852DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D5AE832DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift */; };
20832099
98F28A1D2E01940500A86546 /* Cmab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98F28A1C2E01940500A86546 /* Cmab.swift */; };
@@ -2587,6 +2603,7 @@
25872603
98AC98452DB7B762001405DD /* BucketTests_HoldoutToVariation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BucketTests_HoldoutToVariation.swift; sourceTree = "<group>"; };
25882604
98AC98482DB8FC29001405DD /* DecisionServiceTests_Holdouts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecisionServiceTests_Holdouts.swift; sourceTree = "<group>"; };
25892605
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>"; };
25902607
98D5AE832DBB91C0000D5844 /* OptimizelyUserContextTests_Decide_Holdouts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptimizelyUserContextTests_Decide_Holdouts.swift; sourceTree = "<group>"; };
25912608
98F28A1C2E01940500A86546 /* Cmab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cmab.swift; sourceTree = "<group>"; };
25922609
98F28A2D2E01968000A86546 /* CmabTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CmabTests.swift; sourceTree = "<group>"; };
@@ -3304,6 +3321,7 @@
33043321
children = (
33053322
98F28A402E02DD6D00A86546 /* CmabClient.swift */,
33063323
98F28A552E0451CC00A86546 /* CmabService.swift */,
3324+
98CBECAB2EB3CA6500C06A62 /* CmabCache.swift */,
33073325
);
33083326
path = CMAB;
33093327
sourceTree = "<group>";
@@ -4321,6 +4339,7 @@
43214339
989428BB2DBFA431008BA1C8 /* MockBucketer.swift in Sources */,
43224340
6E14CDAB2423F9EB00010234 /* MockUrlSession.swift in Sources */,
43234341
6E14CDAA2423F9C300010234 /* SDKVersion.swift in Sources */,
4342+
98CBECB32EB3CA6500C06A62 /* CmabCache.swift in Sources */,
43244343
845945C3287758A100D13E11 /* OdpConfig.swift in Sources */,
43254344
6E14CD832423F9A100010234 /* DataStoreQueueStackImpl.swift in Sources */,
43264345
848617F12863E21200B7F41B /* OdpEventApiManager.swift in Sources */,
@@ -4475,6 +4494,7 @@
44754494
6E424D0926324B620081004A /* FeatureVariable.swift in Sources */,
44764495
6E6419DA2657059700C49555 /* NotificationCenterTests_MultiClients.swift in Sources */,
44774496
6E424D0A26324B620081004A /* Rollout.swift in Sources */,
4497+
98CBECB52EB3CA6500C06A62 /* CmabCache.swift in Sources */,
44784498
6E2D5DAE26338CA00002077F /* AtomicDictionaryTests.swift in Sources */,
44794499
6E424D0B26324B620081004A /* Variation.swift in Sources */,
44804500
6E424D0C26324B620081004A /* TrafficAllocation.swift in Sources */,
@@ -4606,6 +4626,7 @@
46064626
6EF8DE1B24BD1BB2008B9488 /* OptimizelyDecideOption.swift in Sources */,
46074627
980CC90D2D833F2800E07D24 /* ExperimentCore.swift in Sources */,
46084628
6E75173722C520D400B2B157 /* MurmurHash3.swift in Sources */,
4629+
98CBECB42EB3CA6500C06A62 /* CmabCache.swift in Sources */,
46094630
6E7517F922C520D400B2B157 /* DataStoreUserDefaults.swift in Sources */,
46104631
C78CAF592445AD8D009FE876 /* OptimizelyJSON.swift in Sources */,
46114632
848617C92863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,
@@ -4648,6 +4669,7 @@
46484669
989428B32DBFA431008BA1C8 /* MockBucketer.swift in Sources */,
46494670
6E75170222C520D400B2B157 /* OptimizelyLogLevel.swift in Sources */,
46504671
6E7516BA22C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
4672+
98CBECB02EB3CA6500C06A62 /* CmabCache.swift in Sources */,
46514673
845945C7287758A300D13E11 /* OdpConfig.swift in Sources */,
46524674
6E75175622C520D400B2B157 /* LogMessage.swift in Sources */,
46534675
848617F62863E21200B7F41B /* OdpEventApiManager.swift in Sources */,
@@ -4866,6 +4888,7 @@
48664888
6E75175E22C520D400B2B157 /* AtomicProperty.swift in Sources */,
48674889
6E9B11DE22C548A200C22D81 /* OptimizelyClientTests_Others.swift in Sources */,
48684890
C78CAF7424482C86009FE876 /* OptimizelyClientTests_OptimizelyJSON.swift in Sources */,
4891+
98CBECBA2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
48694892
6EC6DD3724ABF6990017D296 /* OptimizelyClient+Decide.swift in Sources */,
48704893
6E7516E622C520D400B2B157 /* OPTEventDispatcher.swift in Sources */,
48714894
98F28A612E0451CC00A86546 /* CmabService.swift in Sources */,
@@ -4925,6 +4948,7 @@
49254948
6E75173D22C520D400B2B157 /* MurmurHash3.swift in Sources */,
49264949
6E7516E922C520D400B2B157 /* OPTEventDispatcher.swift in Sources */,
49274950
6E7518A722C520D400B2B157 /* FeatureFlag.swift in Sources */,
4951+
98CBECB92EB3CA6500C06A62 /* CmabCache.swift in Sources */,
49284952
6E75187722C520D400B2B157 /* Variation.swift in Sources */,
49294953
6E7517F322C520D400B2B157 /* DataStoreMemory.swift in Sources */,
49304954
6E7518FB22C520D500B2B157 /* UserAttribute.swift in Sources */,
@@ -5095,6 +5119,7 @@
50955119
84E2E94F2852A378001114AB /* VuidManager.swift in Sources */,
50965120
6E75176322C520D400B2B157 /* AtomicProperty.swift in Sources */,
50975121
6E9B117722C5487100C22D81 /* BatchEventBuilderTests_EventTags.swift in Sources */,
5122+
98CBECB62EB3CA6500C06A62 /* CmabCache.swift in Sources */,
50985123
6E7517DD22C520D400B2B157 /* DefaultNotificationCenter.swift in Sources */,
50995124
6E9B116622C5487100C22D81 /* DecisionServiceTests_UserProfiles.swift in Sources */,
51005125
6E34A6202319EBB800BAE302 /* Notifications.swift in Sources */,
@@ -5252,6 +5277,7 @@
52525277
6E9B11B822C5489600C22D81 /* OTUtils.swift in Sources */,
52535278
98AC97F42DAE9685001405DD /* HoldoutConfigTests.swift in Sources */,
52545279
6E9B119022C5488300C22D81 /* AttributeValueTests.swift in Sources */,
5280+
98CBECBB2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
52555281
6E994B4025A3E6EA00999262 /* DecisionResponse.swift in Sources */,
52565282
84E2E9802855875E001114AB /* OdpEventManager.swift in Sources */,
52575283
6E75175822C520D400B2B157 /* LogMessage.swift in Sources */,
@@ -5390,6 +5416,7 @@
53905416
6E4544AF270E67C800F2CEBC /* NetworkReachability.swift in Sources */,
53915417
6E75177522C520D400B2B157 /* SDKVersion.swift in Sources */,
53925418
848617CD2863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,
5419+
98CBECAE2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
53935420
6E75180722C520D400B2B157 /* DataStoreFile.swift in Sources */,
53945421
8486181D286D188B00B7F41B /* OdpEventApiManagerTests.swift in Sources */,
53955422
6E75183722C520D400B2B157 /* EventForDispatch.swift in Sources */,
@@ -5572,6 +5599,7 @@
55725599
6E424C04263228FD0081004A /* AtomicDictionary.swift in Sources */,
55735600
6E75189922C520D400B2B157 /* Experiment.swift in Sources */,
55745601
6E75178322C520D400B2B157 /* ArrayEventForDispatch+Extension.swift in Sources */,
5602+
98CBECB12EB3CA6500C06A62 /* CmabCache.swift in Sources */,
55755603
6E424BE5263228E90081004A /* AtomicArray.swift in Sources */,
55765604
6E7518A522C520D400B2B157 /* FeatureFlag.swift in Sources */,
55775605
);
@@ -5638,6 +5666,7 @@
56385666
6E4544B4270E67C800F2CEBC /* NetworkReachability.swift in Sources */,
56395667
6E75184622C520D400B2B157 /* Event.swift in Sources */,
56405668
6E7517CE22C520D400B2B157 /* DefaultBucketer.swift in Sources */,
5669+
98CBECB82EB3CA6500C06A62 /* CmabCache.swift in Sources */,
56415670
6E75180A22C520D400B2B157 /* DataStoreFile.swift in Sources */,
56425671
6E7516B822C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
56435672
6E7517C222C520D400B2B157 /* DefaultDatafileHandler.swift in Sources */,
@@ -5747,6 +5776,7 @@
57475776
6E4544B9270E67C800F2CEBC /* NetworkReachability.swift in Sources */,
57485777
6E75184B22C520D400B2B157 /* Event.swift in Sources */,
57495778
6E7517D322C520D400B2B157 /* DefaultBucketer.swift in Sources */,
5779+
98CBECAD2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
57505780
6E75180F22C520D400B2B157 /* DataStoreFile.swift in Sources */,
57515781
6E7516BD22C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
57525782
6E7517C722C520D400B2B157 /* DefaultDatafileHandler.swift in Sources */,
@@ -5861,6 +5891,7 @@
58615891
6EF8DE1A24BD1BB2008B9488 /* OptimizelyDecideOption.swift in Sources */,
58625892
980CC90B2D833F2800E07D24 /* ExperimentCore.swift in Sources */,
58635893
6E75186422C520D400B2B157 /* Rollout.swift in Sources */,
5894+
98CBECAF2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
58645895
6E75179622C520D400B2B157 /* DataStoreQueueStackImpl+Extension.swift in Sources */,
58655896
C78CAF582445AD8D009FE876 /* OptimizelyJSON.swift in Sources */,
58665897
848617C82863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,
@@ -5903,6 +5934,7 @@
59035934
989428BE2DBFA431008BA1C8 /* MockBucketer.swift in Sources */,
59045935
6E7516FC22C520D400B2B157 /* OptimizelyLogLevel.swift in Sources */,
59055936
6E7516B422C520D400B2B157 /* DefaultUserProfileService.swift in Sources */,
5937+
98CBECAC2EB3CA6500C06A62 /* CmabCache.swift in Sources */,
59065938
845945C02877589F00D13E11 /* OdpConfig.swift in Sources */,
59075939
6E75175022C520D400B2B157 /* LogMessage.swift in Sources */,
59085940
848617EE2863E21200B7F41B /* OdpEventApiManager.swift in Sources */,
@@ -6089,6 +6121,7 @@
60896121
75C71A3B25E454460084187E /* ArrayEventForDispatch+Extension.swift in Sources */,
60906122
75C71A3C25E454460084187E /* OptimizelyClient+Extension.swift in Sources */,
60916123
75C71A3D25E454460084187E /* DataStoreQueueStackImpl+Extension.swift in Sources */,
6124+
98CBECB72EB3CA6500C06A62 /* CmabCache.swift in Sources */,
60926125
845945BF2877589F00D13E11 /* OdpConfig.swift in Sources */,
60936126
75C71A3E25E454460084187E /* Array+Extension.swift in Sources */,
60946127
75C71A3F25E454460084187E /* Constants.swift in Sources */,
@@ -6172,6 +6205,7 @@
61726205
6EF8DE1C24BD1BB2008B9488 /* OptimizelyDecideOption.swift in Sources */,
61736206
980CC9132D833F2800E07D24 /* ExperimentCore.swift in Sources */,
61746207
BD6485642491474500F30986 /* Rollout.swift in Sources */,
6208+
98CBECB22EB3CA6500C06A62 /* CmabCache.swift in Sources */,
61756209
BD6485652491474500F30986 /* DataStoreQueueStackImpl+Extension.swift in Sources */,
61766210
BD6485662491474500F30986 /* OptimizelyJSON.swift in Sources */,
61776211
848617CA2863DC2700B7F41B /* OdpSegmentManager.swift in Sources */,

Sources/CMAB/CmabCache.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// Copyright 2022, Optimizely, Inc. and contributors
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
19+
class CmabCache: LruCache<String, CmabCacheValue> {
20+
override func lookup(key: String) -> CmabCacheValue? {
21+
if timeoutInSecs <= 0 {
22+
return nil
23+
}
24+
return super.lookup(key: key)
25+
}
26+
}

Sources/CMAB/CmabService.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ class DefaultCmabService: CmabService {
4848
typealias UserAttributes = [String : Any?]
4949

5050
private let cmabClient: CmabClient
51-
let cmabCache: LruCache<String, CmabCacheValue>
51+
let cmabCache: CmabCache
5252
private let logger = OPTLoggerFactory.getLogger()
5353

54-
init(cmabClient: CmabClient, cmabCache: LruCache<String, CmabCacheValue>) {
54+
init(cmabClient: CmabClient, cmabCache: CmabCache) {
5555
self.cmabClient = cmabClient
5656
self.cmabCache = cmabCache
5757
}
@@ -181,12 +181,12 @@ class DefaultCmabService: CmabService {
181181

182182
extension DefaultCmabService {
183183
static func createDefault() -> DefaultCmabService {
184-
let cache = LruCache<String, CmabCacheValue>(size: DEFAULT_CMAB_CACHE_SIZE, timeoutInSecs: DEFAULT_CMAB_CACHE_TIMEOUT)
184+
let cache = CmabCache(size: DEFAULT_CMAB_CACHE_SIZE, timeoutInSecs: DEFAULT_CMAB_CACHE_TIMEOUT)
185185
return DefaultCmabService(cmabClient: DefaultCmabClient(), cmabCache: cache)
186186
}
187187

188188
static func createDefault(cacheSize: Int, cacheTimeout: Int) -> DefaultCmabService {
189-
let cache = LruCache<String, CmabCacheValue>(size: cacheSize, timeoutInSecs: cacheTimeout)
189+
let cache = CmabCache(size: cacheSize, timeoutInSecs: cacheTimeout)
190190
return DefaultCmabService(cmabClient: DefaultCmabClient(), cmabCache: cache)
191191
}
192192
}

Sources/ODP/OptimizelySdkSettings.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public struct OptimizelySdkSettings {
2828
/// The maximum size of cmab cache
2929
let cmabCacheSize: Int
3030
/// The timeout in seconds of cmab cache
31-
let cmabCacheTitmeoutInSecs: Int
31+
let cmabCacheTimeoutInSecs: Int
3232
/// ODP features are disabled if this is set to true.
3333
let disableOdp: Bool
3434
/// VUID is enabled if this is set to true.
@@ -43,7 +43,7 @@ public struct OptimizelySdkSettings {
4343
/// - timeoutForSegmentFetchInSecs: The timeout in seconds of odp segment fetch (optional. default = 10) - OS default timeout will be used if this is set to zero.
4444
/// - timeoutForOdpEventInSecs: The timeout in seconds of odp event dispatch (optional. default = 10) - OS default timeout will be used if this is set to zero.
4545
/// - cmabCacheSize: The maximum size of cmab cache (optional. default = 100). Set to zero to disable caching.
46-
/// - cmabCacheTitmeoutInSecs: The timeout in seconds of amb cache (optional. default = 600). Set to zero to disable timeout.
46+
/// - cmabCacheTimeoutInSecs: The timeout in seconds of amb cache (optional. default = 600). Set to zero to disable timeout.
4747
/// - disableOdp: Set this flag to true (default = false) to disable ODP features
4848
/// - enableVuid: Set this flag to true (default = false) to enable vuid.
4949
/// - sdkName: Set this flag to override sdkName included in events
@@ -53,15 +53,15 @@ public struct OptimizelySdkSettings {
5353
timeoutForSegmentFetchInSecs: Int = 10,
5454
timeoutForOdpEventInSecs: Int = 10,
5555
cmabCacheSize: Int = 100,
56-
cmabCacheTitmeoutInSecs: Int = 600,
56+
cmabCacheTimeoutInSecs: Int = 600,
5757
disableOdp: Bool = false,
5858
enableVuid: Bool = false,
5959
sdkName: String? = nil,
6060
sdkVersion: String? = nil) {
6161
self.segmentsCacheSize = segmentsCacheSize
6262
self.segmentsCacheTimeoutInSecs = segmentsCacheTimeoutInSecs
6363
self.cmabCacheSize = cmabCacheSize
64-
self.cmabCacheTitmeoutInSecs = cmabCacheTitmeoutInSecs
64+
self.cmabCacheTimeoutInSecs = cmabCacheTimeoutInSecs
6565
self.timeoutForSegmentFetchInSecs = timeoutForSegmentFetchInSecs
6666
self.timeoutForOdpEventInSecs = timeoutForOdpEventInSecs
6767
self.disableOdp = disableOdp

Sources/Optimizely/OptimizelyClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ open class OptimizelyClient: NSObject {
108108
let logger = logger ?? DefaultLogger()
109109
type(of: logger).logLevel = defaultLogLevel ?? .info
110110

111-
let cmabService = DefaultCmabService.createDefault(cacheSize: self.sdkSettings.cmabCacheSize, cacheTimeout: self.sdkSettings.cmabCacheTitmeoutInSecs)
111+
let cmabService = DefaultCmabService.createDefault(cacheSize: self.sdkSettings.cmabCacheSize, cacheTimeout: self.sdkSettings.cmabCacheTimeoutInSecs)
112112

113113
self.registerServices(sdkKey: sdkKey,
114114
logger: logger,

Tests/OptimizelyTests-APIs/OptimizelyClientTests_ODP.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class OptimizelyClientTests_ODP: XCTestCase {
5151
var sdkSettings = OptimizelySdkSettings(segmentsCacheSize: 12,
5252
segmentsCacheTimeoutInSecs: 345,
5353
cmabCacheSize: 50,
54-
cmabCacheTitmeoutInSecs: 120)
54+
cmabCacheTimeoutInSecs: 120)
5555
var optimizely = OptimizelyClient(sdkKey: OTUtils.randomSdkKey, settings: sdkSettings)
5656
let cmabCache = ((optimizely.decisionService as! DefaultDecisionService).cmabService as! DefaultCmabService).cmabCache
5757
XCTAssertEqual(50, cmabCache.maxSize)

0 commit comments

Comments
 (0)