Skip to content

Commit a1fd475

Browse files
[FSSDK-11168] review update
1 parent 04861cc commit a1fd475

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@
187187
<Compile Include="..\OptimizelySDK\Cmab\DefaultCmabClient.cs">
188188
<Link>Cmab\DefaultCmabClient.cs</Link>
189189
</Compile>
190+
<Compile Include="..\OptimizelySDK\Cmab\ICmabService.cs">
191+
<Link>Cmab\ICmabService.cs</Link>
192+
</Compile>
193+
<Compile Include="..\OptimizelySDK\Cmab\DefaultCmabService.cs">
194+
<Link>Cmab\DefaultCmabService.cs</Link>
195+
</Compile>
190196
<Compile Include="..\OptimizelySDK\Cmab\CmabRetryConfig.cs">
191197
<Link>Cmab\CmabRetryConfig.cs</Link>
192198
</Compile>

OptimizelySDK/Cmab/DefaultCmabService.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,21 @@ public CmabDecision GetDecision(ProjectConfig projectConfig,
112112

113113
if (optionSet.Contains(OptimizelyDecideOption.IGNORE_CMAB_CACHE))
114114
{
115+
_logger.Log(LogLevel.DEBUG, "Ignoring CMAB cache.");
115116
return FetchDecision(ruleId, userContext.GetUserId(), filteredAttributes);
116117
}
117118

118119
if (optionSet.Contains(OptimizelyDecideOption.RESET_CMAB_CACHE))
119120
{
121+
_logger.Log(LogLevel.DEBUG, "Resetting CMAB cache.");
120122
_cmabCache.Reset();
121123
}
122124

123125
var cacheKey = GetCacheKey(userContext.GetUserId(), ruleId);
124126

125127
if (optionSet.Contains(OptimizelyDecideOption.INVALIDATE_USER_CMAB_CACHE))
126128
{
129+
_logger.Log(LogLevel.DEBUG, "Invalidating user CMAB cache.");
127130
_cmabCache.Remove(cacheKey);
128131
}
129132

@@ -136,8 +139,11 @@ public CmabDecision GetDecision(ProjectConfig projectConfig,
136139
{
137140
return new CmabDecision(cachedValue.VariationId, cachedValue.CmabUuid);
138141
}
142+
else
143+
{
144+
_cmabCache.Remove(cacheKey);
145+
}
139146

140-
_cmabCache.Remove(cacheKey);
141147
}
142148

143149
var cmabDecision = FetchDecision(ruleId, userContext.GetUserId(), filteredAttributes);

0 commit comments

Comments
 (0)