Skip to content
Permalink
Browse files

[Launcher] Skip unlisted packages, and don't use cache

  • Loading branch information
xen2 committed Jan 10, 2019
1 parent a528cff commit a0459e31eee3c0f649097d812f23c09883169199
Showing with 11 additions and 8 deletions.
  1. +11 −8 sources/assets/Xenko.Core.Packages/NugetStore.cs
@@ -534,7 +534,7 @@ public async Task<IEnumerable<NugetServerPackage>> FindSourcePackages(IReadOnlyC
var res = new List<NugetServerPackage>();
foreach (var packageId in packageIds)
{
await FindSourcePacakgesByIdHelper(packageId, res, repositories, cancellationToken);
await FindSourcePackagesByIdHelper(packageId, res, repositories, cancellationToken);
}
return res;
}
@@ -549,13 +549,13 @@ public async Task<IEnumerable<NugetServerPackage>> FindSourcePackagesById(string
{
var repositories = PackageSources.Select(sourceRepositoryProvider.CreateRepository).ToArray();
var res = new List<NugetServerPackage>();
await FindSourcePacakgesByIdHelper(packageId, res, repositories, cancellationToken);
await FindSourcePackagesByIdHelper(packageId, res, repositories, cancellationToken);
return res;
}

private async Task FindSourcePacakgesByIdHelper(string packageId, List<NugetServerPackage> resultList, SourceRepository [] repositories, CancellationToken cancellationToken)
private async Task FindSourcePackagesByIdHelper(string packageId, List<NugetServerPackage> resultList, SourceRepository [] repositories, CancellationToken cancellationToken)
{
using (var sourceCacheContext = new SourceCacheContext())
using (var sourceCacheContext = new SourceCacheContext { NoCache = true })
{
foreach (var repo in repositories)
{
@@ -565,7 +565,8 @@ private async Task FindSourcePacakgesByIdHelper(string packageId, List<NugetServ
var metadataList = await metadataResource.GetMetadataAsync(packageId, true, true, sourceCacheContext, NativeLogger, cancellationToken);
foreach (var metadata in metadataList)
{
resultList.Add(new NugetServerPackage(metadata, repo.PackageSource.Source));
if (metadata.IsListed)
resultList.Add(new NugetServerPackage(metadata, repo.PackageSource.Source));
}
}
catch (FatalProtocolException)
@@ -602,7 +603,8 @@ public async Task<IQueryable<NugetPackage>> SourceSearch(string searchTerm, bool

foreach (var package in packages)
{
res.Add(new NugetServerPackage(package, repo.PackageSource.Source));
if (package.IsListed)
res.Add(new NugetServerPackage(package, repo.PackageSource.Source));
}
}
}
@@ -634,7 +636,7 @@ public async Task<IEnumerable<NugetPackage>> GetUpdates(PackageName packageName,
var repositories = PackageSources.Select(sourceRepositoryProvider.CreateRepository).ToArray();

var res = new List<NugetPackage>();
using (var context = new SourceCacheContext())
using (var context = new SourceCacheContext { NoCache = true })
{
foreach (var repo in repositories)
{
@@ -644,7 +646,8 @@ public async Task<IEnumerable<NugetPackage>> GetUpdates(PackageName packageName,
var metadataList = await metadataResource.GetMetadataAsync(packageName.Id, includePrerelease, includeAllVersions, context, NativeLogger, cancellationToken);
foreach (var metadata in metadataList)
{
res.Add(new NugetServerPackage(metadata, repo.PackageSource.Source));
if (metadata.IsListed)
res.Add(new NugetServerPackage(metadata, repo.PackageSource.Source));
}
}
catch (FatalProtocolException)

0 comments on commit a0459e3

Please sign in to comment.
You can’t perform that action at this time.