Skip to content

Commit

Permalink
refactor:增添更多日志提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Akimio521 committed Jul 8, 2024
1 parent 6aee67e commit 34bc4e4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@

scheduler = AsyncIOScheduler()

for server in settings.AlistServerList:
cron = server.get("cron")
if cron:
scheduler.add_job(Alist2Strm(**server).run,trigger=CronTrigger.from_crontab(cron))
logger.info(f"{server["id"]}已被添加至后台任务")
else:
logger.warning(f"{server["id"]}未设置Cron")
if settings.AlistServerList:
logger.info("检测到 Alist 服务器配置,正在添加至后台任务")
for server in settings.AlistServerList:
cron = server.get("cron")
if cron:
scheduler.add_job(Alist2Strm(**server).run,trigger=CronTrigger.from_crontab(cron))
logger.info(f"{server["id"]}已被添加至后台任务")
else:
logger.warning(f"{server["id"]}未设置Cron")
else:
logger.warning("未检测到 Alist 服务器配置")

scheduler.start()

Expand Down

0 comments on commit 34bc4e4

Please sign in to comment.