[CHANGES]

This commit is contained in:
max
2025-09-18 00:42:17 +02:00
parent ab532ac6dc
commit 9e173258ed
6 changed files with 18 additions and 27 deletions

View File

@@ -8,14 +8,14 @@ namespace Manager.App.Controllers;
public class CacheController(ILogger<CacheController> logger, CacheService cacheService) : ControllerBase
{
[HttpGet]
public async Task<IActionResult> Cache([FromQuery(Name = "url")] string url)
public async Task<IActionResult> Cache([FromQuery(Name = "url")] string url, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(url))
{
return BadRequest("No url given.");
}
var cacheResult = await cacheService.CacheFromUrl(url);
var cacheResult = await cacheService.CacheFromUrl(url, cancellationToken);
if (!cacheResult.IsSuccess)
{
logger.LogError("Cache request failed. {ErrorMessage}", cacheResult.Error?.Description);