public ProductStoreFactoryBase(Func <string, IProductStore> versionFactory, ElasticConfiguration configuration, VersionedCacheProviderBase cacheProvider, DataOptions options) { _versionFactory = versionFactory; _configuration = configuration; _cacheProvider = cacheProvider; _expiration = options.VersionCacheExpiration; }
public static FactoryBuilder RegisterConsolidationCache(this IUnityContainer container, bool autoRegister, string defaultCode = null) { return(container.RegisterCustomFactory(autoRegister, (context, customer) => { var currentCode = defaultCode ?? customer.CustomerCode; var logger = container.Resolve <ILogger>(); var cacheProvider = new VersionedCacheProviderBase(logger); var invalidator = new DpcContentInvalidator(cacheProvider, logger); var connectionProvider = new ExplicitConnectionProvider(customer); var tracker = new StructureCacheTracker(customer.ConnectionString, customer.DatabaseType); var watcher = new CustomerCoreCacheItemWatcher(InvalidationMode.All, TimeSpan.FromSeconds(15), invalidator, connectionProvider, logger, databaseType: customer.DatabaseType); context.Register <ICacheProvider>(currentCode, cacheProvider); context.Register(currentCode, cacheProvider); context.Register <IContentInvalidator>(currentCode, invalidator); context.Register <ICacheItemWatcher>(currentCode, watcher); watcher.AttachTracker(tracker); watcher.Start(); }) .For <ICacheProvider>(defaultCode) .For <VersionedCacheProviderBase>(defaultCode) .For <IContentInvalidator>(defaultCode) .For <ICacheItemWatcher>(defaultCode)); }
public RateLimitAttribute(ElasticConfiguration configuration, VersionedCacheProviderBase cacheProvider, string profile) { _configuration = configuration; _cacheProvider = cacheProvider; Profile = profile; }
public SettingsFromContentCoreService(VersionedCacheProviderBase cacheProvider, IConnectionProvider connectionProvider, int settingsContentId) : base(connectionProvider, cacheProvider) { _cacheProvider = cacheProvider; _settingsContentId = settingsContentId; }
public ContentDefinitionService(ISettingsService settingsService, VersionedCacheProviderBase cacheProvider, IArticleService articleService, IConnectionProvider connectionProvider) { _settingsService = settingsService; _cacheProvider = cacheProvider; _articleService = articleService; _customer = connectionProvider.GetCustomer(); }
public TarantoolJsonService(ISettingsService settingsService, VersionedCacheProviderBase cacheProvider, IHttpClientFactory factory, IOptions <IntegrationProperties> intProps) { var tntUrl = intProps.Value.TarantoolApiUrl; _baseUri = !String.IsNullOrEmpty(tntUrl) ? new Uri(tntUrl) : null; _settingsService = settingsService; _cacheProvider = cacheProvider; _factory = factory; _expiration = TimeSpan.FromHours(1); }
public ArticleDependencyService(IContentDefinitionService contentDefinitionService, IServiceFactory serviceFactory, VersionedCacheProviderBase cacheProvider, ISettingsService settingsService, IConnectionProvider connectionProvider) { _contentDefinitionService = contentDefinitionService; _customer = connectionProvider.GetCustomer(); _cacheProvider = cacheProvider; _prodDefContentId = int.Parse(settingsService.GetSetting(SettingsTitles.PRODUCT_DEFINITIONS_CONTENT_ID)); _articleService = serviceFactory.GetArticleService(); _fieldService = serviceFactory.GetFieldService(); }
public ProductController(Func <string, string, IAction> getAction, VersionedCacheProviderBase versionedCacheProvider, Func <string, IArticleFormatter> getFormatter, IProductLocalizationService localizationService, IProductService productService, QPHelper helper ) { _getAction = getAction; _versionedCacheProvider = versionedCacheProvider; _getFormatter = getFormatter; _localizationService = localizationService; _productService = productService; _qpHelper = helper; }
public CustomerCodeInstance(IConnectionProvider connectionProvider, ILogger logger) { CacheProvider = new VersionedCacheProviderBase(logger); Invalidator = new DpcContentInvalidator(CacheProvider, logger); var customer = connectionProvider.GetCustomer(); if (customer != null) { Watcher = new CustomerCoreCacheItemWatcher(InvalidationMode.All, TimeSpan.FromSeconds(15), Invalidator, connectionProvider, logger, databaseType: customer.DatabaseType); Tracker = new StructureCacheTracker(customer.ConnectionString, customer.DatabaseType); Watcher.AttachTracker(Tracker); ((CacheItemWatcherBase)Watcher).Start(); } }
public RegionTagService(VersionedCacheProviderBase cacheProvider, ISettingsService settingsService, IRegionService regionService, IArticleService articleService, IFieldService fieldService, IConnectionProvider connectionProvider) { _cacheProvider = cacheProvider; _settingsService = settingsService; _regionService = regionService; _articleService = articleService; _fieldService = fieldService; _customer = connectionProvider.GetCustomer(); TagsContentId = int.Parse(_settingsService.GetSetting(SettingsTitles.REGIONAL_TAGS_CONTENT_ID)); TagValuesContentId = int.Parse(_settingsService.GetSetting(SettingsTitles.REGIONAL_TAGS_VALUES_CONTENT_ID)); RegionsContentId = int.Parse(_settingsService.GetSetting(SettingsTitles.REGIONS_CONTENT_ID)); TagTitleName = _settingsService.GetSetting(SettingsTitles.REGIONAL_TAGS_KEY_FIELD_NAME) ?? "Title"; TagValueName = _settingsService.GetSetting(SettingsTitles.REGIONAL_TAGS_VALUES_VALUE_FIELD_NAME) ?? "Value"; }
public LocalSystemCachedLoader(IContentDefinitionService definitionService, VersionedCacheProviderBase cacheProvider, ICacheItemWatcher cacheItemWatcher, IReadOnlyArticleService articleService, IFieldService fieldService, ISettingsService settingsService, IList <IConsumerMonitoringService> consumerMonitoringServices, IArticleFormatter formatter, IConnectionProvider connectionProvider) : base(definitionService, cacheProvider, cacheItemWatcher, articleService, fieldService, settingsService, consumerMonitoringServices, formatter, connectionProvider) { DataDirectory = AppDomain.CurrentDomain.GetData("DataDirectory") as string; if (DataDirectory == null) { throw new InvalidOperationException("Должен быть определен DataDirectory"); } ArchiveFiles = true; }
public QpElasticConfiguration( IContentProvider <ElasticIndex> indexProvider, IContentProvider <HighloadApiUser> userProvider, IContentProvider <HighloadApiLimit> limitProvider, IContentProvider <HighloadApiMethod> methodProvider, VersionedCacheProviderBase cacheProvider, IHttpClientFactory factory, PolicyRegistry registry, ILoggerFactory loggerFactory, DataOptions dataOptions ) : base(factory, registry, loggerFactory, dataOptions) { _indexProvider = indexProvider; _userProvider = userProvider; _limitProvider = limitProvider; _methodProvider = methodProvider; _cacheProvider = cacheProvider; }
public ProductStoreFactory(Func <string, IProductStore> versionFactory, ElasticConfiguration configuration, VersionedCacheProviderBase cache, DataOptions options) : base(versionFactory, configuration, cache, options) { }
public RegionService(VersionedCacheProviderBase cacheProvider, ISettingsService settingsService, IConnectionProvider connectionProvider) { _cacheProvider = cacheProvider; _settingsService = settingsService; _customer = connectionProvider.GetCustomer(); }
protected ContentProviderBaseCached(ISettingsService settingsService, IConnectionProvider connectionProvider, VersionedCacheProviderBase cacheProvider) : base(settingsService, connectionProvider) { _cacheProvider = cacheProvider; }
public DBConnectorProxy(IConnectionProvider connectionProvider, VersionedCacheProviderBase cacheProvider) { _customer = connectionProvider.GetCustomer(); _cacheProvider = cacheProvider; }
public RateLimitRouteAttribute(ElasticConfiguration configuration, VersionedCacheProviderBase cacheProvider, string profile) : base(configuration, cacheProvider, profile) { }
public QpCachedContextStorage(VersionedCacheProviderBase cacheProvider) { _cacheProvider = cacheProvider; CacheTime = TimeSpan.FromHours(1); }
public SettingsFromQpCoreService(VersionedCacheProviderBase cacheProvider, IConnectionProvider connectionProvider) : base(connectionProvider, cacheProvider) { _cacheProvider = cacheProvider; }
public NotificationChannelProvider(ISettingsService settingsService, IConnectionProvider connectionProvider, VersionedCacheProviderBase cacheProvider) : base(settingsService, connectionProvider, cacheProvider) { }
public StatusProvider(VersionedCacheProviderBase cacheProvider, IConnectionProvider connectionProvider) { _cacheProvider = cacheProvider; _connectionProvider = connectionProvider; }
public DpcContentInvalidator(VersionedCacheProviderBase cacheProvider, ILogger logger) { _cacheProvider = cacheProvider; _logger = logger; }