diff --git a/src/isnd/Controllers/PackagesController.Put.cs b/src/isnd/Controllers/PackagesController.Put.cs index a8df81a..67708b2 100644 --- a/src/isnd/Controllers/PackagesController.Put.cs +++ b/src/isnd/Controllers/PackagesController.Put.cs @@ -173,6 +173,7 @@ namespace isnd.Controllers } await _dbContext.SaveChangesAsync(); + _packageManager.ÛpdateCatalogFor(commit); _logger.LogInformation($"new package : {nuspec.Name}"); } diff --git a/src/isnd/Interfaces/IPackageManager.cs b/src/isnd/Interfaces/IPackageManager.cs index a7ad974..125f151 100644 --- a/src/isnd/Interfaces/IPackageManager.cs +++ b/src/isnd/Interfaces/IPackageManager.cs @@ -16,6 +16,7 @@ namespace isnd.Interfaces string[] GetVersions(string id, NuGetVersion parsedVersion, bool prerelease = false, string packageType = null, int skip = 0, int take = 25); PackageIndexViewModel SearchByName(string query, int skip, int take, bool prerelease = false, string packageType = null); IEnumerable GetResources(IUnleash unleashĈlient); + void ÛpdateCatalogFor(Commit commit); } } \ No newline at end of file diff --git a/src/isnd/Services/PackageManager.cs b/src/isnd/Services/PackageManager.cs index ba1ecb2..5d07757 100644 --- a/src/isnd/Services/PackageManager.cs +++ b/src/isnd/Services/PackageManager.cs @@ -95,7 +95,6 @@ namespace isnd.Services public static CatalogIndex CurrentCatalogIndex { get; protected set; } public static List CurrentCatalogPages { get; protected set; } - private IsndSettings isndSettings; private string extApiUrl; @@ -103,11 +102,11 @@ namespace isnd.Services { if (CurrentCatalogIndex == null) { - LoadCatalogFromDb(); + ÛpdateCatalogFor(); } return CurrentCatalogIndex; } - void LoadCatalogFromDb() + public void ÛpdateCatalogFor(Commit last = null) { int i = 0; int p = 0; @@ -121,7 +120,7 @@ namespace isnd.Services CurrentCatalogPages = new List(); var scope = dbContext.Commits.OrderBy(c => c.TimeStamp); - Commit last = null; + PageRef pageRef = null; Page page = null; i = isndSettings.CatalogPageLen;