Manual Retry Budget Tracker (ParleyKit/ManualRetryBudget.swift)

parley · ios/ParleyKit/Sources/ParleyKit/ManualRetryBudget.swift · swift · Apache-2.0
voice, lang:swift, tag:ios, tag:retry, tag:logic

Manages a persistent budget for manual re-transcription requests per recording. Use this to prevent abuse of retry mechanisms when request metadata is ephemeral.

// Source: https://github.com/pathorsAI/parley | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import Foundation

/// How many hand-triggered re-transcriptions each recording has already spent.
///
/// ## Why this is not a field on the queued request
///
/// `TranscriptCoverage.BackfillPolicy.maxManualRetries` bounds how often a
/// person may ask for the same audio to be transcribed again. The obvious place
/// to keep the count is the queue entry that carries the request — and that is
/// where the *attempt ordinal* does live. It cannot be where the budget lives,
/// because a finished backfill deletes its queue entry: the moment a re-run
/// succeeds, a count kept there is gone

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key