mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-08 17:36:37 +08:00
refactor: 改进调度器启动逻辑并清理日志
- 修改 `key_checker.py` 中的调度器启动逻辑,确保即使实例存在但未运行时也能启动。 - 在 `key_checker.py` 中添加了调度器启动和状态日志。 - 移除了 `application.py` 中数据库断开连接和调度器停止时的冗余关闭日志。
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user