mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-10-15 12:14:54 +00:00
chore: remove dead code found in redundancy audit
- provider.truncate: zero callers (oneLineStr is the used superset) - gateway.normalizeModel: zero callers - config.resolvedAPIKey: zero callers (core.resolveSourceKey is the live equivalent) - Stats.Records: zero callers (CSV export uses AuditRecords) - store.containsString: zero callers - Config.MaxConcurrent: global inflight-cap field never read; per-source MaxConcurrent is what actually drives semaphores. Legacy configs carrying a top-level max_concurrent key still load (yaml.v3 ignores unknown fields — verified by test). - gui renderer esc(): zero callers; renderer uses textContent, and the embedded WebUI has its own esc()
This commit is contained in:
@ -128,15 +128,3 @@ func (b *SecretBox) MustDecrypt(v string) string {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// resolvedAPIKey resolves a source key from api_key_env (env var) or api_key.
|
||||
func resolvedAPIKey(src Source, box *SecretBox) (string, error) {
|
||||
if src.APIKeyEnv != "" {
|
||||
v := os.Getenv(src.APIKeyEnv)
|
||||
if v == "" {
|
||||
return "", fmt.Errorf("source %s: env %s is empty or unset", src.Name, src.APIKeyEnv)
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
return box.MustDecrypt(src.APIKey), nil
|
||||
}
|
||||
Reference in New Issue
Block a user