Skip to content

Commit

Permalink
updated archive auto gen to use queue method
Browse files Browse the repository at this point in the history
  • Loading branch information
shukriadams committed May 3, 2024
1 parent 2beb467 commit ae2c31d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
8 changes: 0 additions & 8 deletions src/Tetrifact.Core/ArchiveService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ public string GetArchiveProgressKey(string packageId)
return $"archive_progress_{packageId}";
}

public void EnsurePackageArchive(string packageId)
{
using (Stream stream = this.GetPackageAsArchive(packageId))
{
// createa and immediately dispose of stream
}
}

public string GetPackageArchivePath(string packageId)
{
return Path.Combine(_settings.ArchivePath, $"{packageId}.zip");
Expand Down
6 changes: 0 additions & 6 deletions src/Tetrifact.Core/IArchiveService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ public interface IArchiveService
/// <param name="packageId"></param>
void QueueArchiveCreation(string packageId);

/// <summary>
/// Creates a package archive without locking up package stream
/// </summary>
/// <param name="packageId"></param>
void EnsurePackageArchive(string packageId);

/// <summary>
/// Cleans out trash in archives folder.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Tetrifact.Core/PackageCreateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ PackageCreateResult IPackageCreateService.Create(PackageCreateArguments newPacka

if (_settings.AutoCreateArchiveOnPackageCreate){
_log.LogInformation("Generating package archive");
_archiveService.EnsurePackageArchive(newPackage.Id);
_archiveService.QueueArchiveCreation(newPackage.Id);
}

return new PackageCreateResult { Success = true, PackageHash = _workspace.Manifest.Hash };
Expand Down
4 changes: 0 additions & 4 deletions src/Tetrifact.Web/Controllers/PackagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,6 @@ public ActionResult AddPackage([FromForm]PackageCreateFromPost post)
IsArchive = post.IsArchive
});

// force flush in-memory list of packages
if (result.Success)
_packageListCache.Clear();

if (result.Success)
{
// force flush in-memory list of packages
Expand Down

0 comments on commit ae2c31d

Please sign in to comment.