From c662e2c4e3d849e15cf8876c90548bbcb0782b44 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Sun, 8 Jan 2023 16:32:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20url=E8=BF=87=E9=95=BF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E4=B8=8A=E6=8A=A5=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/audit/gatherer.py | 3 ++- pkg/utils/updater.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/audit/gatherer.py b/pkg/audit/gatherer.py index 34e7054e..9ec9581e 100644 --- a/pkg/audit/gatherer.py +++ b/pkg/audit/gatherer.py @@ -25,7 +25,7 @@ class DataGatherer: def __init__(self): self.load_from_db() try: - self.version_str = pkg.utils.updater.get_commit_id_and_time_and_msg()[:50 if len(pkg.utils.updater.get_commit_id_and_time_and_msg()) > 50 else len(pkg.utils.updater.get_commit_id_and_time_and_msg())] + self.version_str = pkg.utils.updater.get_commit_id_and_time_and_msg()[:40 if len(pkg.utils.updater.get_commit_id_and_time_and_msg()) > 40 else len(pkg.utils.updater.get_commit_id_and_time_and_msg())] except: pass @@ -34,6 +34,7 @@ class DataGatherer: config = pkg.utils.context.get_config() if hasattr(config, "report_usage") and not config.report_usage: return + print("http://rockchin.top:18989/usage?service_name=qchatgpt.{}&version={}&count={}".format(subservice_name, self.version_str, count)) res = requests.get("http://rockchin.top:18989/usage?service_name=qchatgpt.{}&version={}&count={}".format(subservice_name, self.version_str, count)) if res.status_code != 200 or res.text != "ok": logging.warning("report to server failed, status_code: {}, text: {}".format(res.status_code, res.text)) diff --git a/pkg/utils/updater.py b/pkg/utils/updater.py index 8b832eba..3dedc238 100644 --- a/pkg/utils/updater.py +++ b/pkg/utils/updater.py @@ -52,7 +52,7 @@ def get_current_version_info() -> str: version_str += "提交编号: "+str(entry.commit.id)[2:9] + "\n" tz = datetime.timezone(datetime.timedelta(hours=entry.commit.commit_timezone // 3600)) dt = datetime.datetime.fromtimestamp(entry.commit.commit_time, tz) - version_str += "时间: "+dt.strftime('%Y-%m-%d %H:%M:%S') + "\n" + version_str += "时间: "+dt.strftime('%m-%d %H:%M:%S') + "\n" version_str += "说明: "+str(entry.commit.message, encoding="utf-8").strip() + "\n" version_str += "提交作者: '" + str(entry.commit.author)[2:-1] + "'" break