public async Task AddPackageAsync(IPackage package, CancellationToken cancellationToken) { var lucenePackage = await DownloadOrMoveOrAddPackageToFileSystemAsync(package, cancellationToken); Log.Info(m => m("Indexing package {0} {1}", package.Id, package.Version)); await Indexer.AddPackageAsync(lucenePackage, cancellationToken); }
private async Task AddToIndex(string fullPath) { if (FileSystem.IsTempFile(fullPath)) { return; } var existingPackage = PackageRepository.LoadFromIndex(fullPath); if (existingPackage != null && !IndexDifferenceCalculator.TimestampsMismatch( existingPackage, FileSystem.GetLastModified(fullPath))) { return; } var package = PackageRepository.LoadFromFileSystem(fullPath); await Indexer.AddPackageAsync(package, CancellationToken.None); }