You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a per-client-IP concurrent clone limiter to prevent a single client
from monopolizing all clone capacity. When a client exceeds the
configured limit, requests are rejected with 429 Too Many Requests
and a Retry-After header.
Configurable via max-clones-per-client in the git strategy config
block. Defaults to 0 (disabled). The tracker counts in-flight clones
per client IP and releases slots when clone jobs complete.
New metric cachew.git.clone_rejections_total (by client IP) provides
observability into rate-limited requests.
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d4a57-1477-707c-bb89-5543fddff0e7
Copy file name to clipboardExpand all lines: internal/strategy/git/git.go
+40-6Lines changed: 40 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,9 @@ type Config struct {
39
39
MirrorSnapshotInterval time.Duration`hcl:"mirror-snapshot-interval,optional" help:"How often to generate mirror snapshots for pod bootstrap. 0 uses snapshot-interval. Defaults to 2h." default:"2h"`
40
40
RepackInterval time.Duration`hcl:"repack-interval,optional" help:"How often to run full repack. 0 disables." default:"0"`
41
41
// ServerURL is embedded as remote.origin.url in snapshots so git pull goes through cachew.
42
-
ServerURLstring`hcl:"server-url,optional" help:"Base URL of this cachew instance, embedded in snapshot remote URLs." default:"${CACHEW_URL}"`
43
-
ZstdThreadsint`hcl:"zstd-threads,optional" help:"Threads for zstd compression/decompression (0 = all CPU cores)." default:"0"`
42
+
ServerURLstring`hcl:"server-url,optional" help:"Base URL of this cachew instance, embedded in snapshot remote URLs." default:"${CACHEW_URL}"`
43
+
ZstdThreadsint`hcl:"zstd-threads,optional" help:"Threads for zstd compression/decompression (0 = all CPU cores)." default:"0"`
0 commit comments