Skip to content

Commit

Permalink
fix: 无法获取远程版本信息
Browse files Browse the repository at this point in the history
  • Loading branch information
Colsrch committed Oct 17, 2022
1 parent 511abad commit 7f36070
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/core/config.exp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Madoka 配置文件
# 请将该文件复制为 config.yaml 并填充该文件
# 请将该文件复制至 app/data/config.yaml 并填充该文件

name: Madoka # 机器人名字
master_qq: # 机器人主人 QQ
Expand Down Expand Up @@ -44,6 +44,6 @@ message_queue:

event:
# 群撤回消息监控
# True: 转发至 master
# False: 回送至原群
groupRecall2me: true
# true: 转发至 master
# false: 回送至原群
groupRecall2me: false
3 changes: 1 addition & 2 deletions app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class MadokaInfo:
NAME = "Madoka"
VERSION = "4.0.2"
VERSION = "4.0.3"
DOCS = "https://madoka.colsrch.cn"
REPO = "https://github.com/MadokaProject/Madoka"
REMOTE_REPO_VERSION = "v4"
Expand All @@ -24,7 +24,6 @@ class _Bot(BaseSettings, extra=Extra.ignore):
account: int
verify_key: str
host: AnyHttpUrl = "http://127.0.0.1:8080"
heartbeat_log: bool = False


class _Database(BaseSettings, extra=Extra.ignore):
Expand Down
6 changes: 5 additions & 1 deletion app/util/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"version": "4.0.2",
"version": "4.0.3",
"update_log": [
{
"version": "4.0.3",
"info": "修复无法获取远程版本信息的问题,修复已知问题"
},
{
"version": "4.0.2",
"info": "调整获取远程版本的url, 导出requirements.txt"
Expand Down
4 changes: 3 additions & 1 deletion app/util/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

import aiohttp.client
from loguru import logger

Expand Down Expand Up @@ -30,7 +32,7 @@ def compare_version(remote_version: str, native_version: str) -> bool:
async def check_version():
"""检查版本信息"""
try:
remote_info = await general_request(MadokaInfo.REMOTE_VERSION_URL, method="get", _type="json")
remote_info = json.loads(await general_request(MadokaInfo.REMOTE_VERSION_URL, method="get", _type="text"))
remote_version = remote_info["version"]
remote_update_logs = remote_info["update_log"]
logger.info(f"Remote Version: {remote_version}")
Expand Down

0 comments on commit 7f36070

Please sign in to comment.