fix: preserve background connection state and durable disconnect logs
This commit is contained in:
+3
-1
@@ -576,8 +576,10 @@ def create_app(data_dir=None, manager=None, config=None, updates=None) -> FastAP
|
||||
def public_summary(value):
|
||||
if not isinstance(value, dict):
|
||||
raise HTTPException(500, "账号状态返回格式不正确")
|
||||
result = {field: value.get(field) for field in ("id", "label", "connected", "demo", "running", "busy", "revision", "error")}
|
||||
result = {field: value.get(field) for field in ("id", "label", "connected", "demo", "running", "busy", "revision", "error",
|
||||
"connection_state", "connection_message", "last_game_success_at", "next_retry_at")}
|
||||
result["error"] = public_error(result["error"])
|
||||
result["connection_message"] = public_error(result["connection_message"])
|
||||
player = value.get("player")
|
||||
result["player"] = {field: player.get(field) for field in ("name", "level", "exp", "next_exp", "money", "ke", "ti")} if isinstance(player, dict) else None
|
||||
return public(result)
|
||||
|
||||
Reference in New Issue
Block a user