Exemplo n.º 1
0
 public CacheAdminHandler(IUserDataStore userDataStore, IIdQueueStore idQueueStore, IGroupConfigStore groupConfigStore, IUserDataCache userDataCache, IGroupConfigCache groupConfigCache, IIdQueueCache idQueueCache, IMentionConfigCache mentionConfigCache, ILogger <CacheAdminHandler> logger)
 {
     // store all services
     this._log = logger;
     // caches
     this._groupConfigCache   = groupConfigCache;
     this._userDataCache      = userDataCache;
     this._idQueueCache       = idQueueCache;
     this._mentionConfigCache = mentionConfigCache;
     // stores
     this._userDataStore    = userDataStore;
     this._idQueueStore     = idQueueStore;
     this._groupConfigStore = groupConfigStore;
 }
Exemplo n.º 2
0
        public MongoUserDataStore(IMongoConnection databaseConnection, IOptionsMonitor <DatabaseOptions> databaseOptions,
                                  IHostApplicationLifetime hostLifetime, ILogger <MongoUserDataStore> logger, IUserDataCache cache)
            : base(databaseConnection, databaseOptions)
        {
            this._log            = logger;
            this._cache          = cache;
            this._replaceOptions = new ReplaceOptions()
            {
                IsUpsert = true, BypassDocumentValidation = false
            };
            this.RecreateBatchInserter();
            this.OnMongoClientChanged(base.MongoConnection.Client);

            this._hostStoppingRegistration = hostLifetime.ApplicationStopping.Register(_batchInserter.Flush);
            this._configChangeRegistration = base.DatabaseOptions.OnChange(_ => RecreateBatchInserter());
        }
Exemplo n.º 3
0
        public CacheCleaner(ILogger <CacheCleaner> logger, IOptionsMonitor <CachingOptions> cachingOptions,
                            IUserDataStore userDataStore, IIdQueueStore idQueueStore, IGroupConfigStore groupConfigStore,
                            IUserDataCache userDataCache, IGroupConfigCache groupConfigCache, IIdQueueCache idQueueCache, IMentionConfigCache mentionConfigCache)
        {
            this._log            = logger;
            this._cachingOptions = cachingOptions;
            // caches
            this._userDataCache      = userDataCache;
            this._groupConfigCache   = groupConfigCache;
            this._idQueueCache       = idQueueCache;
            this._mentionConfigCache = mentionConfigCache;
            // stores
            this._userDataStore    = userDataStore;
            this._idQueueStore     = idQueueStore;
            this._groupConfigStore = groupConfigStore;

            this._optionsChangeHandle = this._cachingOptions.OnChange(_ =>
            {
                this.RestartAllLoops();
            });
        }