uploadlock

package
v1.261107.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package uploadlock serializes App Store Connect asset uploads across asc processes on one machine.

Several asc processes uploading at once multiply their requests against one App Store Connect account, which answers with 429s, and share one network link, which pushes slow uploads past their deadline. The lock makes a second upload wait for the first instead.

Index

Constants

View Source
const EnvVar = "ASC_UPLOAD_LOCK"

EnvVar disables the lock when set to a false value such as 0.

Variables

This section is empty.

Functions

func Acquire

func Acquire(ctx context.Context, stderr io.Writer) (func(), error)

Acquire takes the asc upload lock shared by every process of this OS user and returns the function that releases it. The operating system also releases the lock when the process exits, including after a crash.

While another asc process holds the lock, Acquire tells stderr once and waits up to 30 minutes. Callers should take the lock before they start any upload deadline, so the wait does not count against it. If the lock file cannot be opened, Acquire warns and returns without locking, so an unusable cache directory never blocks an upload. ASC_UPLOAD_LOCK=0 skips the lock.

func SetDirForTest

func SetDirForTest(dir string) func()

SetDirForTest replaces the directory that holds the lock file. The returned function restores the previous value.

func SetWaitLimitForTest

func SetWaitLimitForTest(limit time.Duration) func()

SetWaitLimitForTest replaces how long Acquire waits for another upload. The returned function restores the previous value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL