Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private void AddToIndex(
            WorkRoot workRoot,
            string path,
            IEnumerable <IConnectedService> connectedServices,
            IBoostDbContext dbContext)
        {
            Log.Information("Indexing: {Path}", path);

            GitRepositoryIndex?repoIndex = Index(path);

            if (repoIndex is { })
Ejemplo n.º 3
0
        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);
        }