master
jshixiong 4 months ago
parent 9f3b9eaa01
commit 8659811c2f

@ -46,10 +46,10 @@ def get_online_size():
logging.debug(f"请求{url} 返回参数: {data}")
return data.get('data', {}).get('online_num', 0)
except ValueError as json_err:
except ValueError:
# 处理可能的请求错误
logging.info(f"online_size解析错误: {json_err}")
except requests.exceptions.HTTPError as http_err:
logging.error(f"online_size请求发生错误: {http_err}")
logging.info("online_size解析错误")
except requests.exceptions.HTTPError:
logging.error("online_size请求发生错误")
return 0
Loading…
Cancel
Save