コード例 #1
0
 private CacheItemPolicy GetCorrectCacheItemPolicy(URN id)
 {
     return(id.IsSimpleTeam()
                ? _simpleTeamCacheItemPolicy
                : new CacheItemPolicy {
         SlidingExpiration = SdkInfo.AddVariableNumber(OperationManager.ProfileCacheTimeout, 20), RemovedCallback = OnCacheItemRemoval
     });
 }
コード例 #2
0
 /// <inheritdoc />
 public void AddEventIdForTimelineIgnore(URN eventId, int producerId, Type messageType)
 {
     if (producerId == 4) // BetPal
     {
         if (_ignoreEventsTimelineCache.Contains(eventId.ToString()))
         {
             _ignoreEventsTimelineCache.Get(eventId.ToString()); // to update sliding expiration
         }
         else
         {
             CacheLog.LogDebug($"Received {messageType.Name} - added {eventId} to the ignore timeline list");
             _ignoreEventsTimelineCache.Add(eventId.ToString(),
                                            DateTime.Now,
                                            new CacheItemPolicy {
                 SlidingExpiration = SdkInfo.AddVariableNumber(OperationManager.IgnoreBetPalTimelineSportEventStatusCacheTimeout, 20)
             });
         }
     }
 }