Commit 3fece453 authored by 崔为之's avatar 崔为之 💪🏽

Update project

parent eada417c
......@@ -7,25 +7,31 @@
# @Email : StudentCWZ@outlook.com
# @Date : 2023/11/11 14:50
# @File : init_apscheduler.py
# @Description :
# @Description : Initializes the APScheduler extension for a Flask application.
"""
from apscheduler.triggers.interval import IntervalTrigger
from flask import Flask
from apscheduler.triggers.interval import IntervalTrigger
from application.libs.flask_apscheduler import APScheduler
from application.libs.tasks import task
# Initialize APScheduler
scheduler = APScheduler()
def init_tasks(app: Flask) -> None:
"""
Initialize the task extension.
Initializes the task extension for a Flask application.
Args:
app (Flask): The Flask application.
Returns:
None
:param app: The Flask application instance.
:return: None
Raises:
TypeError: If the provided argument is not a Flask application instance.
"""
if not isinstance(app, Flask):
raise TypeError(f'Expected a Flask application instance, got {type(app).__name__}')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment