增加定时同步组织架构

This commit is contained in:
2026-01-15 19:24:52 +08:00
parent 4a51ec89cc
commit 723c7817b6
17 changed files with 240 additions and 132 deletions

View File

@@ -1,12 +1,11 @@
from fastscheduler import FastScheduler
from service import get_wecom
from service.sync.department import sync_department
from service.sync.employee import sync_department_user
scheduler = FastScheduler(quiet=True)
@scheduler.every(4).hours
@scheduler.daily.at("04:00")
async def background_task():
wecom = get_wecom()
await wecom.get_departments()
await sync_department()
await sync_department_user()