From 8671f627c21c1bfbeaa35db6a212b76b9aefaac7 Mon Sep 17 00:00:00 2001
From: xuyonghao <898441624@qq.com>
Date: 星期一, 10 二月 2025 10:41:30 +0800
Subject: [PATCH] 报告生成同步
---
main.py | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/main.py b/main.py
index dc14409..bf04686 100644
--- a/main.py
+++ b/main.py
@@ -24,10 +24,12 @@
from app.api.group import group_router
from app.api.role import role_router
from app.models.base_model import init_db
+from app.task.delete_execl_file import delete_file_after_delay
# from app.models.base_model import init_db
from app.task.fetch_agent import sync_agents, initialize_agents, sync_agents_v2, sync_knowledge, \
sync_resources_from_json
from app.init_config.init_run_data import sync_default_data
+from app.task.sync_account_token import sync_token, start_sync_token_task
init_db()
@@ -41,12 +43,10 @@
# sync_agents()
-
- # await sync_default_data()
- #
- # sync_agents_v2()
- # sync_knowledge()
- # sync_resources_from_json()
+ await sync_default_data()
+ sync_agents_v2()
+ sync_knowledge()
+ sync_resources_from_json()
yield
# 鍦ㄥ簲鐢ㄥ叧闂椂鎵ц娓呯悊鎿嶄綔锛堝鏋滈渶瑕侊級
pass
@@ -62,7 +62,7 @@
# 璁剧疆 CORS 涓棿浠�
# app.add_middleware(
# CORSMiddleware,
-# allow_origins=["http://192.168.20.119:9303", "http://192.168.20.119:9301", "http://smartai.com:8293","http://localhost:9303", "http://127.0.0.1:9303","http://localhost:5173","http://192.168.20.158:5173"],
+# allow_origins=["*"],
# allow_credentials=True,
# allow_methods=["*"], # 鍏佽鎵�鏈夋柟娉�
# allow_headers=["*"], # 鍏佽鎵�鏈夊ご閮�
@@ -70,6 +70,8 @@
# 鍒涘缓璋冨害鍣�
scheduler = BackgroundScheduler()
scheduler.add_job(sync_agents_v2, 'interval', minutes=60, id="sync_resource_data")
+scheduler.add_job(start_sync_token_task, 'interval', minutes=5, id="sync_token_1")
+# scheduler.add_job(delete_file_after_delay, 'interval', minutes=10, id="delete_file_after_delay")
scheduler.start()
app.include_router(auth_router, prefix='/api/auth', tags=["auth"])
--
Gitblit v1.8.0