feat(laya): integrate HTTP ranking service
Add the pinned Laya HTTP ranker and production composition, configure the CPU Compose service and cache, and document operations. Cover protocol validation, generation orchestration, sanitized logging, and Compose wiring. Refs #17 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -8,6 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
LayaURL string
|
||||
LayaTimeout time.Duration
|
||||
LayaAPIKey string
|
||||
OpenFIGIAPIKey string
|
||||
OpenFIGITimeout time.Duration
|
||||
DatabaseURL string
|
||||
@ -57,7 +60,20 @@ func Load() (*Config, error) {
|
||||
}
|
||||
timeout = parsed
|
||||
}
|
||||
layaURL := os.Getenv("LAYA_URL")
|
||||
if layaURL == "" {
|
||||
layaURL = "http://laya:8000"
|
||||
}
|
||||
layaTimeout := 120 * time.Second
|
||||
if value := os.Getenv("LAYA_TIMEOUT"); value != "" {
|
||||
parsed, err := time.ParseDuration(value)
|
||||
if err != nil || parsed <= 0 || parsed > 10*time.Minute {
|
||||
return nil, fmt.Errorf("LAYA_TIMEOUT must be a duration greater than 0 and at most 10m")
|
||||
}
|
||||
layaTimeout = parsed
|
||||
}
|
||||
return &Config{
|
||||
LayaURL: layaURL, LayaTimeout: layaTimeout, LayaAPIKey: os.Getenv("LAYA_API_KEY"),
|
||||
OpenFIGIAPIKey: os.Getenv("OPENFIGI_API_KEY"),
|
||||
OpenFIGITimeout: timeout,
|
||||
DatabaseURL: dbURL,
|
||||
|
||||
Reference in New Issue
Block a user