switched to fib backoff
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user