mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
add bandwidth limiter
This commit is contained in:
parent
3f8d16511e
commit
71bc2aaed7
10 changed files with 157 additions and 22 deletions
|
|
@ -18,11 +18,16 @@ var (
|
|||
gitclient *httpc.Client
|
||||
)
|
||||
|
||||
func InitReq(cfg *config.Config) {
|
||||
func InitReq(cfg *config.Config) error {
|
||||
initHTTPClient(cfg)
|
||||
if cfg.GitClone.Mode == "cache" {
|
||||
initGitHTTPClient(cfg)
|
||||
}
|
||||
err := SetGlobalRateLimit(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func initHTTPClient(cfg *config.Config) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue