Improves package download and caching
All checks were successful
Build and Push Docker Images / build (src/LiquidCode.Tester.Gateway/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-gateway-roman, gateway) (push) Successful in 53s
Build and Push Docker Images / build (src/LiquidCode.Tester.Worker/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-worker-roman, worker) (push) Successful in 50s

Adds package caching to reduce download frequency.

Introduces a `PackageDownloadService` with memory caching to store downloaded packages,
identified by mission ID, for reuse. Uses concurrent locks to prevent race conditions during download.

Modifies the worker client service to optionally delete the package after sending,
allowing cached packages to be retained.
This commit is contained in:
2025-11-02 20:05:50 +03:00
parent b95d94d796
commit bf7bd0ad6b
6 changed files with 130 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ builder.Services.AddOpenApi();
// Add HttpClient
builder.Services.AddHttpClient();
builder.Services.AddMemoryCache();
// Register application services
builder.Services.AddSingleton<IPackageDownloadService, PackageDownloadService>();