format .
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from fastapi import FastAPI
|
||||
from fastscheduler.fastapi_integration import create_scheduler_routes
|
||||
|
||||
from scheduler.scheduler import scheduler
|
||||
|
||||
def init_scheduler_router(app : FastAPI):
|
||||
|
||||
def init_scheduler_router(app: FastAPI):
|
||||
app.include_router(create_scheduler_routes(scheduler))
|
||||
scheduler.start()
|
||||
scheduler.start()
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from fastscheduler import FastScheduler
|
||||
|
||||
from service import get_wecom
|
||||
|
||||
scheduler = FastScheduler(quiet=True)
|
||||
|
||||
|
||||
@scheduler.every(10).seconds
|
||||
def background_task():
|
||||
print("Background work")
|
||||
@scheduler.every(4).hours
|
||||
async def background_task():
|
||||
wecom = get_wecom()
|
||||
|
||||
await wecom.get_departments()
|
||||
|
||||
Reference in New Issue
Block a user