mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 13:38:43 +00:00
@@ -92,18 +92,17 @@ class AutoScheduler:
|
|||||||
|
|
||||||
# 执行自动分析
|
# 执行自动分析
|
||||||
if self.config_manager.get_enable_auto_analysis():
|
if self.config_manager.get_enable_auto_analysis():
|
||||||
# 检查是否今天已经执行过
|
# 检查今天是否已经执行过,防止重复执行
|
||||||
today = now.date()
|
if self.last_execution_date == target_time.date():
|
||||||
if self.last_execution_date == today:
|
logger.info(f"今天 {target_time.date()} 已经执行过自动分析,跳过执行")
|
||||||
logger.info(f"今天 {today} 已经执行过自动分析,跳过执行")
|
|
||||||
# 等待到明天再检查
|
# 等待到明天再检查
|
||||||
await asyncio.sleep(3600) # 等待1小时后再检查
|
await asyncio.sleep(3600) # 等待1小时后再检查
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.info("开始执行定时分析")
|
logger.info("开始执行定时分析")
|
||||||
await self._run_auto_analysis()
|
await self._run_auto_analysis()
|
||||||
self.last_execution_date = today # 记录执行日期
|
self.last_execution_date = target_time.date() # 记录执行日期
|
||||||
logger.info(f"定时分析执行完成,记录执行日期: {today}")
|
logger.info(f"定时分析执行完成,记录执行日期: {self.last_execution_date}")
|
||||||
else:
|
else:
|
||||||
logger.info("自动分析已禁用,跳过执行")
|
logger.info("自动分析已禁用,跳过执行")
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user