This commit is contained in:
greeneclipse committed 2026-10-20 17:28:06 +02:00
1 parent c83347b9a5
commit fd83a7c523
2 files changed
+27 -3

No files matched your search

+8
View File
@@ -563,6 +563,14 @@ func (p *Pipeline) RetryJob(ctx context.Context, companyID, id uuid.UUID) (Job,
if p.Limiter != nil && !p.Limiter.Allow(companyID) {
return Job{}, ErrRateLimited
}
// Load the exact output selections saved at job creation, so retry credit
// checks match the original charge (including jobs with a subset of outputs).
var selectedOutputs []string
if err := p.Pool.QueryRow(ctx, `
SELECT processing_types FROM processing_jobs
WHERE id = $1 AND company_id = $2`, id, companyID).Scan(&selectedOutputs); err != nil {
return Job{}, fmt.Errorf("processing: load retry outputs for job %s: %w", id, err)
}
if err := p.assertProcessingGates(ctx, companyID, job.ProcessingType, job.TotalProducts, selectedOutputs...); err != nil {
return Job{}, err
}