refactor: 改进调度器启动逻辑并清理日志

- 修改 `key_checker.py` 中的调度器启动逻辑,确保即使实例存在但未运行时也能启动。
- 在 `key_checker.py` 中添加了调度器启动和状态日志。
- 移除了 `application.py` 中数据库断开连接和调度器停止时的冗余关闭日志。
This commit is contained in:
snaily
2025-04-26 03:27:13 +08:00
parent 705d602dee
commit 7098c8755f
2 changed files with 3 additions and 3 deletions
+3 -1
View File
@@ -90,8 +90,10 @@ scheduler_instance = None
def start_scheduler():
global scheduler_instance
if scheduler_instance is None:
if scheduler_instance is None or not scheduler_instance.running:
logger.info("Starting scheduler...")
scheduler_instance = setup_scheduler()
logger.info("Scheduler is already running.")
def stop_scheduler():
global scheduler_instance