Hero: varianten op de achtergrond knippen; upload en opslaan antwoorden direct

Opslaan van 8 foto's met gewijzigde focus duurde 40 s op een snelle pc en ruim 3 minuten op de Pi (proxy-timeout 60 s gaf 504, hero niet bewaard).
Upload bewaart het origineel en antwoordt; HeroRenderService knipt de set per afbeelding en schakelt over zodra de set compleet is (oude set blijft ondertussen live; afbeelding zonder set wordt niet gepubliceerd). Opslaan legt alleen de focus vast. Admin toont 'wordt verwerkt' en ververst zelf; Seed-Hero wacht tot alles klaar is. Metingen: HeroSaveTimingTests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 21:14:00 +01:00
co-authored by Claude Sonnet 5.5
parent 969bb14d86
commit 852a162bc3
23 changed files with 414 additions and 46 deletions
@@ -112,6 +112,16 @@ public class HeroAsfSiteE2ETests : IClassFixture<AsfSiteFactory>
seed.GetProperty("buttons").EnumerateArray().Select(b => new HeroButtonRequest(b.GetProperty("label").GetString(), b.GetProperty("target").GetString())).ToList(),
true, null, null, slides, focusEdits), caller, default));
await InScope(async sp =>
{
// The variants are cut by the background renderer in production; here it is run to the end at once.
while (await sp.GetRequiredService<IHeroImageService>().RenderNextPendingAsync(new HashSet<Guid>(), default) is not null)
{
}
return true;
});
var response = await client.GetAsync("/");
var page = await response.Content.ReadAsStringAsync();
var api = await client.GetStringAsync("/api/v1/hero");
@@ -133,6 +133,15 @@ public class HeroInjectionPipelineTests : IClassFixture<HeroInjectionFactory>
await InScope(async sp => await sp.GetRequiredService<IHeroService>().SaveAsync(
new HeroSaveRequest("Andrea Slop", "Lifestyle fotograaf · Huizen", null, "slideshow", [new HeroButtonRequest("Lees meer", "/over-mij")], true, null, null,
[new HeroSlideRequest(null, Guid.Parse(image.Id), "Zwangerschapsfoto in de duinen")]), caller, default));
await InScope(async sp =>
{
// The variants are cut by the background renderer in production; here it is run to the end at once.
while (await sp.GetRequiredService<IHeroImageService>().RenderNextPendingAsync(new HashSet<Guid>(), default) is not null)
{
}
return true;
});
var live = await client.GetAsync("/hero");
var body = await live.Content.ReadAsStringAsync();