Add concurrency limits and configuration options for SteamCache

- Introduced maxConcurrentRequests and maxRequestsPerClient fields in the Config struct to manage request limits.
- Updated the SteamCache implementation to utilize these new configuration options for controlling concurrent requests.
- Enhanced the ServeHTTP method to enforce global and per-client rate limiting using semaphores.
- Modified the root command to accept new flags for configuring concurrency limits via command-line arguments.
- Updated tests to reflect changes in the SteamCache initialization and request handling logic.
This commit is contained in:
2025-09-02 06:50:42 -05:00
parent 7fb1fcf21f
commit 9ca8fa4a5e
6 changed files with 203 additions and 29 deletions

1
go.mod
View File

@@ -15,5 +15,6 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.12.0 // indirect
)