feat: 增加用户信息接口
This commit is contained in:
8
main.py
8
main.py
@@ -5,7 +5,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from fastapi import FastAPI
|
||||
from starlette.middleware.cors import CORSMiddleware
|
||||
|
||||
from config.database import get_db
|
||||
from config.database import SessionLocal
|
||||
from routers import routers
|
||||
from service import agent_service
|
||||
|
||||
@@ -16,7 +16,8 @@ def article_job_task():
|
||||
"""定时执行的任务"""
|
||||
try:
|
||||
print(f"今日资讯定时任务执行: {datetime.now()}")
|
||||
agent_service.query_article_agent(get_db())
|
||||
db = SessionLocal()
|
||||
agent_service.query_article_agent(db)
|
||||
except Exception as e:
|
||||
print(f"今日资讯定时任务异常: {e}")
|
||||
|
||||
@@ -24,7 +25,8 @@ def recipe_job_task():
|
||||
"""定时执行的任务"""
|
||||
try:
|
||||
print(f"今日菜谱定时任务执行: {datetime.now()}")
|
||||
agent_service.query_recipe_agent(get_db())
|
||||
db = SessionLocal()
|
||||
agent_service.query_recipe_agent(db)
|
||||
except Exception as e:
|
||||
print(f"今日菜谱定时任务异常: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user