Correzione: un tempo zero per il fotogramma annulla subito
verifica / controlli (push) Successful in 20s
verifica / prove (push) Successful in 20m39s
verifica / installatore (push) Successful in 2m18s
verifica / immagine (push) Successful in 16m39s

Con Budget = 0 FrameService annullava con CancelAfter, cioè con un timer:
su una macchina carica il timer scattava dopo la decodifica di un video
piccolo e la prova del 503 riceveva 200 (esecuzione 518 di main, lavoro
immagine). Ora un tempo zero annulla subito, come già VideoFrameDecoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-28 19:41:39 +01:00
1 parent f8a45eb482
commit 7d2346dfca
2 files changed
+15 -1

No files matched your search

+10 -1
View File
@@ -144,7 +144,16 @@ public sealed class FrameService(IClock clock)
ArgumentNullException.ThrowIfNull(path);
var image = MediaConverter.ImageFormatOf(format) ?? throw new BadRequestException("I fotogrammi si salvano in JPG, PNG o WEBP senza perdita.");
using var budget = CancellationTokenSource.CreateLinkedTokenSource(ct);
budget.CancelAfter(Budget);
if (Budget <= TimeSpan.Zero)
{
// No time at all: cancelled now, not by a timer that a busy machine may fire after a quick decode.
budget.Cancel();
}
else
{
budget.CancelAfter(Budget);
}
try
{
await _one.WaitAsync(budget.Token).ConfigureAwait(false);