public async Task <int> IndexWorkRootAsync( WorkRoot workRoot, Action <string>?onProgress = null, CancellationToken cancellationToken = default) { using IBoostDbContext dbContext = _dbContextFactory.Open(DbOpenMode.ReadWrite); IEnumerable <IConnectedService> connectedServices = await _connectedServiceManager .GetServicesAsync(cancellationToken); ClearIndex(workRoot.Name); int indexCount = 0; foreach (DirectoryInfo?dir in new DirectoryInfo(workRoot.Path) .GetDirectories()) { AddToIndex(workRoot, dir.FullName, connectedServices, dbContext); GitRepositoryIndex?repoIndex = Index(dir.FullName); onProgress?.Invoke(dir.FullName); indexCount++; } return(indexCount); }
private void AddToIndex( WorkRoot workRoot, string path, IEnumerable <IConnectedService> connectedServices, IBoostDbContext dbContext) { Log.Information("Indexing: {Path}", path); GitRepositoryIndex?repoIndex = Index(path); if (repoIndex is { })
public async Task IndexRepository( WorkRoot workRoot, string path, CancellationToken cancellationToken) { using IBoostDbContext dbContext = _dbContextFactory.Open(DbOpenMode.ReadWrite); IEnumerable <IConnectedService> connectedServices = await _connectedServiceManager .GetServicesAsync(cancellationToken); AddToIndex(workRoot, path, connectedServices, dbContext); }