pub struct TransferConfig {
pub concurrency: usize,
pub max_attempts: u32,
pub initial_backoff: Duration,
pub backoff_max: Duration,
pub url_rewriter: Option<UrlRewriter>,
pub upload_url_rewriter: Option<UrlRewriter>,
pub batch_size: usize,
pub detect_content_type: bool,
}Expand description
Tunables for the transfer queue.
Defaults aim at “sensible for a developer laptop on a corporate
VPN”: not too aggressive on concurrency, generous retries for
flaky links. Upstream Git LFS scales concurrency to CPU count;
this crate hard-codes 8 and lets callers override.
Fields§
§concurrency: usizeMax number of concurrent in-flight transfers.
max_attempts: u32Total attempts per object, including the first.
9 means “try once, then up to 8 retries”. Matches upstream’s
defaultMaxRetries = 8 (upstream counts retries; we count
attempts, hence +1).
initial_backoff: DurationSleep before the first retry. Doubled before each subsequent retry,
capped at backoff_max.
backoff_max: DurationUpper bound for exponential backoff between retries.
url_rewriter: Option<UrlRewriter>Optional rewriter applied to download action URLs before
transfer. Carries url.<base>.insteadOf when
lfs.transfer.enablehrefrewrite=true. None ⇒ no rewriting.
upload_url_rewriter: Option<UrlRewriter>Optional rewriter applied to upload + verify action URLs. Carries
url.<base>.pushInsteadOf (falling back to insteadOf) when
lfs.transfer.enablehrefrewrite=true. None ⇒ no push-direction
rewriting, in which case the upload-side falls back to
url_rewriter.
batch_size: usizeMax objects per POST /objects/batch call. The transfer queue
chunks the input list into runs of this size and issues one
batch API call per chunk. Default: 100 (matches upstream’s
lfs.transfer.batchSize default). Values < 1 are clamped to 1.
detect_content_type: boollfs.<url>.contenttype — when true (default), the basic
upload adapter sniffs the first 512 bytes of each object and
sets the Content-Type header on the action PUT to the
detected MIME type. When false, the adapter sends
application/octet-stream so a misconfigured CDN can’t reject
the upload based on its content sniffing. Honored only when
the batch response didn’t already set a Content-Type in
action.header.
Trait Implementations§
Source§impl Clone for TransferConfig
impl Clone for TransferConfig
Source§fn clone(&self) -> TransferConfig
fn clone(&self) -> TransferConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more