Expand description
Port lease allocation.
Assignment is deterministic: the first four bytes of
SHA-256(repo_id:branch) are interpreted as a big-endian u32, reduced
modulo the configured range size, and offset by port_range_start.
Collisions fall back to sequential probing.
Functions§
- allocate_
port - Allocate a port for a branch by probing from preferred port, wrapping around.
- compute_
preferred_ port - Compute the preferred port for a branch within a port range.
- is_
lease_ expired - Check if a port lease is expired.
- make_
lease - Build a PortLease with 8-hour TTL.
- renew_
lease - Renew a lease — extend expires_at by another 8 hours from now.
- sweep_
expired_ leases - Sweep expired leases from the map, returning how many were removed.