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

Update project

parent eada417c
...@@ -7,25 +7,31 @@ ...@@ -7,25 +7,31 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/11 14:50 # @Date : 2023/11/11 14:50
# @File : init_apscheduler.py # @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 flask import Flask
from apscheduler.triggers.interval import IntervalTrigger
from application.libs.flask_apscheduler import APScheduler from application.libs.flask_apscheduler import APScheduler
from application.libs.tasks import task from application.libs.tasks import task
# Initialize APScheduler
scheduler = APScheduler() scheduler = APScheduler()
def init_tasks(app: Flask) -> None: 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. Raises:
:return: None TypeError: If the provided argument is not a Flask application instance.
""" """
if not isinstance(app, Flask): if not isinstance(app, Flask):
raise TypeError(f'Expected a Flask application instance, got {type(app).__name__}') 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