app_config 表移出 REQUIRED_TABLES: 不存在时 fail-safe 放行
自洽问题: 原先 REQUIRED_TABLES 里列了 nano_banana_app_config, 但 _check_version 明明有"读不到就放行"的 fail-safe。 同一张表一边说"必须存在",一边说"不存在也没事",逻辑矛盾。 结果是: 如果 migration 还没在生产 DB 跑, 1.1.0 客户端启动就会在 "表存在性校验"硬挂, 弹"应用启动失败,请联系 @柴进", 完全绕不过 fail-safe。 修正: app_config 作为"版本门禁"的后端存储不是启动必需品。 - 没表/没记录 → fail-safe 放行, 版本门禁临时关闭 - 有表+有记录 → 正常做版本校验 - migration 可以任意时刻跑, 不阻塞发布节奏
Showing
1 changed file
with
4 additions
and
1 deletions
| ... | @@ -26,7 +26,10 @@ logger = logging.getLogger(__name__) | ... | @@ -26,7 +26,10 @@ logger = logging.getLogger(__name__) |
| 26 | VERSION_ERROR_PREFIX = "VERSION_TOO_OLD::" | 26 | VERSION_ERROR_PREFIX = "VERSION_TOO_OLD::" |
| 27 | 27 | ||
| 28 | REQUIRED_DB_FIELDS = ("host", "port", "user", "password", "database") | 28 | REQUIRED_DB_FIELDS = ("host", "port", "user", "password", "database") |
| 29 | REQUIRED_TABLES = ("nano_banana_user_use_log", "nano_banana_user_log", "nano_banana_app_config") | 29 | # 注意 nano_banana_app_config 不在这里 —— |
| 30 | # 这张表是"版本门禁"的后端存储,不是启动必需。_check_version 里已经有 fail-safe: | ||
| 31 | # 表不存在 / 记录缺失 → WARNING 放行。这样 migration 可在任意时刻跑,不阻塞发布。 | ||
| 32 | REQUIRED_TABLES = ("nano_banana_user_use_log", "nano_banana_user_log") | ||
| 30 | REQUIRED_USE_LOG_COLUMNS = ( | 33 | REQUIRED_USE_LOG_COLUMNS = ( |
| 31 | "user_name", "device_name", "prompt", "result_path", "status", | 34 | "user_name", "device_name", "prompt", "result_path", "status", |
| 32 | "error_message", "model", "duration_ms", "finish_reason", | 35 | "error_message", "model", "duration_ms", "finish_reason", | ... | ... |
-
Please register or sign in to post a comment