fix: 消耗任务四类遗漏修复 + 清理死变量
volc_consume.py: - payload 模型参数路由:doubao 系 max_completion_tokens+reasoning_effort minimal, 其他模型 max_tokens(旧 MONITOR_TARGETS 实测配置,否则 doubao 消耗会 400 失效) - _send_ark URL 单源:直接拼 HUOSHAN_BASE_URL(与 config.yaml 同 env),删 ARK_HOST - 速率三档对齐旧 auto_consume(正常 15-40s / 极速 / 动态),避免 plan 大时 60s/次拖过 00:00 - run_consume_all 单次拉包复用,消除 6 次重复分页 volc_limit_sync.py: - 修复 DEBUG 打印残留 current_peak 引用(v2 简化后已删变量,DEBUG 模式会 NameError) - 清理旧遗留死变量 SYNC_INTERVAL / mode_str / display_limit,去重 limit_str
This commit is contained in:
+4
-9
@@ -91,7 +91,6 @@ REGION = "cn-beijing"
|
||||
|
||||
# Daemon Config
|
||||
BUFFER = 300000 # User requested 30w buffer
|
||||
SYNC_INTERVAL = 60
|
||||
CHECK_INTERVAL = 10
|
||||
THRESHOLD = 300000
|
||||
|
||||
@@ -539,10 +538,8 @@ def restore_blocked_models():
|
||||
# Morning Window: 07:00 - 13:00
|
||||
if 7 <= beijing_hour < 13:
|
||||
interval = 1800 # 30 minutes
|
||||
mode_str = "Morning/Window (30m)"
|
||||
else:
|
||||
interval = 14400 # 4 hours
|
||||
mode_str = "Off-Peak (4h)"
|
||||
|
||||
if now - last_restore_check < interval:
|
||||
return
|
||||
@@ -806,7 +803,9 @@ class DailyLimitHandler(CustomLogger):
|
||||
effective_limit = get_effective_limit(
|
||||
clean_model, api_base, current_usage=current_total
|
||||
)
|
||||
display_limit = f"/{int(effective_limit):,}" if effective_limit else ""
|
||||
limit_str = (
|
||||
f" | Limit: {int(effective_limit):,}" if effective_limit is not None else ""
|
||||
)
|
||||
|
||||
# Get Dynamic Remaining for Log
|
||||
dynamic_key = f"limit:dynamic:volcengine:remaining:{clean_model}"
|
||||
@@ -829,10 +828,6 @@ class DailyLimitHandler(CustomLogger):
|
||||
print(f"DEBUG: Dynamic key not found: {dynamic_key}")
|
||||
|
||||
key_display = key.split(":", 2)[-1]
|
||||
# Display Limit clearly
|
||||
limit_str = (
|
||||
f" | Limit: {int(effective_limit):,}" if effective_limit is not None else ""
|
||||
)
|
||||
log(
|
||||
f"📊 [Usage] {key_display}: +{total_tokens} (Today: {current_total:,}{rem_display}{limit_str})",
|
||||
level="INFO",
|
||||
@@ -1419,7 +1414,7 @@ def active_monitor_loop():
|
||||
static_limit, stable_limit
|
||||
)
|
||||
print(
|
||||
f"DEBUG: {target} PeakPool={int(current_peak):,} | Usage={int(current_usage):,} | {format_limit_debug_fields(static_limit=static_limit, stable_limit=stable_limit, effective_limit=effective_limit)}",
|
||||
f"DEBUG: {target} Pool={int(total_pool):,} | Usage={int(current_usage):,} | {format_limit_debug_fields(static_limit=static_limit, stable_limit=stable_limit, effective_limit=effective_limit)}",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user