diff --git a/application/extensions/init_apscheduler.py b/application/extensions/init_apscheduler.py index f8d2e38414dafee0ef98f8e09a8a425192d3caad..159a2f54a270d36dd33912c70ec55c98c33a23a6 100644 --- a/application/extensions/init_apscheduler.py +++ b/application/extensions/init_apscheduler.py @@ -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__}')