internal void SetDirection(BlobStoreType source, BlobStoreType destination) { switch (source) { case BlobStoreType.GridFs: _originalStore = _config.OriginalGridFsBlobStore; _artifactStore = _config.ArtifactsGridFsBlobStore; break; case BlobStoreType.FileSystem: _originalStore = _config.OriginalFileSystemBlobStore; _artifactStore = _config.ArtifactsFileSystemBlobStore; break; default: throw new NotSupportedException($"Source {source} not supported"); } switch (destination) { case BlobStoreType.GridFs: _destinationOriginalStore = _config.OriginalGridFsBlobStore; _destinationArtifactsStoreAdvanced = _config.ArtifactsGridFsBlobStore; break; case BlobStoreType.FileSystem: _destinationOriginalStore = _config.OriginalFileSystemBlobStore; _destinationArtifactsStoreAdvanced = _config.ArtifactsFileSystemBlobStore; break; default: throw new NotSupportedException($"Source {source} not supported"); } }
internal void SyncAllTenants(BlobStoreType source, BlobStoreType destination, Boolean startFromBeginning) { foreach (var tenant in _tenantsConfig) { var synchronyzer = new BlobStoreSynchronizer(tenant, _logger, startFromBeginning); synchronyzer.SetDirection(source, destination); _logger.Info($"Start synchronization of tenant {tenant.TenantId}"); synchronyzer.PerformSync(); _logger.Info($"Synchronization of tenant {tenant.TenantId} Completed. Press a key to continue!"); Console.ReadKey(); } }