生图线路可用环境变量指定,便于低价线路上游欠费时测试
This commit is contained in:
parent
7454237c04
commit
fef5ab3466
@ -204,6 +204,10 @@ pub fn select_model(m: &Value) -> Result<Value, String> {
|
||||
continue;
|
||||
}
|
||||
let id = route["id"].as_str().unwrap_or("");
|
||||
// 运维可用环境变量指定本次使用的生图线路,例如低价线路上游欠费时。
|
||||
if std::env::var("PHOTOCRAFT_IMAGE_ROUTE_OPTION").is_ok_and(|pinned| pinned != id) {
|
||||
continue;
|
||||
}
|
||||
if !token(id)
|
||||
|| i["headers"]["X-Relay-Route-Option"] != id
|
||||
|| i["headers"].as_object().is_none_or(|h| h.keys().any(|k| k != "X-Relay-Route-Option"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user