switched to fib backoff

This commit is contained in:
Luxferre
2026-07-30 09:53:36 +03:00
parent 1cc6ddb2e4
commit d49339d770
4 changed files with 519 additions and 5 deletions
+5 -2
View File
@@ -25,8 +25,11 @@ func main() {
keyPath := flag.String("key", "", "Path to plaintext file containing expected auth token")
csvUpdater := flag.String("csv-updater", "", "Command to run to update the configuration CSV file")
csvUpdateInterval := flag.Int("csv-update-interval", 10, "Interval in minutes with which to run the CSV updater command")
retryDelayMs := flag.Int("retry-delay", 100, "Base delay in milliseconds for Fibonacci failover retries (0 to disable)")
flag.Parse()
retryDelay := time.Duration(*retryDelayMs) * time.Millisecond
var authTokens []string
if *keyPath != "" {
content, err := os.ReadFile(*keyPath)
@@ -74,8 +77,8 @@ func main() {
// Register routes
mux := http.NewServeMux()
mux.HandleFunc("/v1/models", handleModels(cm, authTokens))
mux.HandleFunc("/v1/chat/completions", handleChatCompletions(cm, authTokens))
mux.HandleFunc("/v1/images/generations", handleImageGenerations(cm, authTokens))
mux.HandleFunc("/v1/chat/completions", handleChatCompletions(cm, authTokens, retryDelay))
mux.HandleFunc("/v1/images/generations", handleImageGenerations(cm, authTokens, retryDelay))
server := &http.Server{
Addr: fmt.Sprintf(":%d", *port),