Пример #1
0
 private static void CheckCacheForVehicleAndTypeFillIfRequired(
     string vinU, AnalyticRuleType type)
 {
     if (!Cache.ContainsKey(vinU) ||
         (Cache.ContainsKey(vinU) && Cache[vinU].Get(type) == null))
     {
         lock (Cache)
         {
             if (!Cache.ContainsKey(vinU))
             {
                 Cache[vinU] = new StatisticsPerVehicleSubCache();
             }
             Cache[vinU].Set(GetFromService(type, vinU), type);
         }
     }
 }
Пример #2
0
 private static void CheckCacheForVehicleFillIfRequired(string vinU)
 {
     if (!Cache.ContainsKey(vinU))
     {
         Cache[vinU] = new StatisticsPerVehicleSubCache();
     }
     try
     {
         foreach (AnalyticRuleType type in AnalyticRuleSettingsCache.GetAvailableTypes(vinU))
         {
             CheckCacheForVehicleAndTypeFillIfRequired(vinU, type);
         }
     }
     catch (Exception e)
     {
         Log.Error(e, "Can not get available analytic types for vehicle.");
         throw;
     }
 }