chore: add swqos client

This commit is contained in:
2025-12-26 11:13:31 +08:00
parent b484273cba
commit 0d2e29cacf
19 changed files with 839 additions and 3 deletions

29
pkg/swqos/keep_alive.go Normal file
View File

@@ -0,0 +1,29 @@
package swqos
import (
"context"
"net/http"
"time"
)
func DoKeepAlive(ctx context.Context, url string) {
for {
select {
case <-ctx.Done():
return
case <-time.After(time.Second * 55):
}
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
continue
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
continue
}
resp.Body.Close()
}
}