update
This commit is contained in:
+12
-2
@@ -296,7 +296,7 @@ class AlphaSimulator:
|
||||
"timestamp": time.strftime("%Y-%m-%d %H:%M:%S")
|
||||
}
|
||||
|
||||
if result["status"] == "success":
|
||||
if result["status"] == "ok":
|
||||
result_data["alpha_id"] = result["alpha_id"]
|
||||
success_count += 1
|
||||
print(f"✅ 模拟成功 - Alpha ID: {result['alpha_id']} - 耗时: {time_consuming}秒")
|
||||
@@ -334,9 +334,19 @@ class AlphaSimulator:
|
||||
|
||||
def _print_summary(self, success_count, fail_count):
|
||||
"""打印总结信息"""
|
||||
print(f"\n总计: 成功 {success_count} 个, 失败 {fail_count} 个")
|
||||
now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
print_result = f"\n总计: 成功 {success_count} 个, 失败 {fail_count} 个\n\n 完成时间: {now}"
|
||||
print(print_result)
|
||||
print(f"所有结果已保存到 PostgreSQL 数据库 {self.db_manager.database_name} 的 simulation 表中")
|
||||
_send_to_gotify(print_result, now)
|
||||
|
||||
def _send_to_gotify(self, text, now):
|
||||
"""将结果推送到 gotify """
|
||||
title = f"alpha模拟结果 时间: {now}"
|
||||
try:
|
||||
resp = httpx.post("https://gotify.erhe.top/message?token=AvKJCJwQKU6yLP8", json={'title': title, 'message': text})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def main():
|
||||
simulator = AlphaSimulator()
|
||||
|
||||
Reference in New Issue
Block a user