public override async Task InitializeAsync() { await base.InitializeAsync(); _migrationIndex = new MigrationIndex(_configuration); await _migrationIndex.DeleteAsync(); await _migrationIndex.ConfigureAsync(); var cacheClient = new InMemoryCacheClient(); var messageBus = new InMemoryMessageBus(); _lockProvider = new CacheLockProvider(cacheClient, messageBus, Log); _migrationStateRepository = new MigrationStateRepository(_migrationIndex); var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton <VersionedWithoutVersionMigration>(); serviceCollection.AddSingleton <Version1Migration>(); serviceCollection.AddSingleton <Version2Migration>(); serviceCollection.AddSingleton <Version3Migration>(); serviceCollection.AddSingleton <FailingMigration>(); serviceCollection.AddSingleton <FailingResumableMigration>(); serviceCollection.AddSingleton <RepeatableMigration>(); _serviceProvider = serviceCollection.BuildServiceProvider(); _migrationManager = new MigrationManager(_serviceProvider, _migrationStateRepository, _lockProvider, Log); }
public ExceptionlessElasticConfiguration( AppOptions appOptions, IQueue <WorkItemData> workItemQueue, JsonSerializerSettings serializerSettings, ICacheClient cacheClient, IMessageBus messageBus, ILoggerFactory loggerFactory ) : base(workItemQueue, cacheClient, messageBus, loggerFactory) { _appOptions = appOptions; _serializerSettings = serializerSettings; _logger.LogInformation("All new indexes will be created with {ElasticsearchNumberOfShards} Shards and {ElasticsearchNumberOfReplicas} Replicas", _appOptions.ElasticsearchOptions.NumberOfShards, _appOptions.ElasticsearchOptions.NumberOfReplicas); AddIndex(Stacks = new StackIndex(this)); AddIndex(Events = new EventIndex(this, appOptions)); AddIndex(Migrations = new MigrationIndex(this, _appOptions.ElasticsearchOptions.ScopePrefix + "migrations", appOptions.AppMode == AppMode.Development ? 0 : 1)); AddIndex(Organizations = new OrganizationIndex(this)); AddIndex(Projects = new ProjectIndex(this)); AddIndex(Tokens = new TokenIndex(this)); AddIndex(Users = new UserIndex(this)); AddIndex(WebHooks = new WebHookIndex(this)); }