From 3fece453e09bf8a0bb00248a2cb103f492ac802e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E4=B8=BA=E4=B9=8B?= <560397@gree.com.cn> Date: Tue, 21 Nov 2023 13:38:29 +0800 Subject: [PATCH] Update project --- application/extensions/init_apscheduler.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/application/extensions/init_apscheduler.py b/application/extensions/init_apscheduler.py index f8d2e38..159a2f5 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__}') -- GitLab