mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
fix(auth): 在请求上下文中添加会话ID设置
feat(gencode): 改进导入验证错误信息格式 fix(scheduler): 修复任务重复添加问题并合并错过的任务 refactor(router): 优化路由转换逻辑避免Layout嵌套 feat(middleware): 增强会话ID提取功能并改进日志记录
This commit is contained in:
@@ -44,7 +44,7 @@ executors = {
|
||||
}
|
||||
# 配置默认参数
|
||||
job_defaults = {
|
||||
'coalesce': False, # 是否合并执行
|
||||
'coalesce': True, # 合并执行错过的任务
|
||||
'max_instances': 1, # 最大实例数
|
||||
}
|
||||
# 配置调度器
|
||||
@@ -166,7 +166,11 @@ class SchedulerUtil:
|
||||
job_list = await JobCRUD(auth).get_obj_list_crud()
|
||||
for item in job_list:
|
||||
cls.remove_job(job_id=item.id) # 删除旧任务
|
||||
cls.add_job(item)
|
||||
# 检查任务是否已经存在
|
||||
existing_job = cls.get_job(job_id=item.id)
|
||||
if not existing_job:
|
||||
# 任务不存在才添加
|
||||
cls.add_job(item)
|
||||
# 根据数据库中保存的状态来设置任务状态
|
||||
if hasattr(item, 'status') and item.status == "1":
|
||||
# 如果任务状态为暂停,则立即暂停刚添加的任务
|
||||
|
||||
Reference in New Issue
Block a user