去除装饰器,后续慢慢优化

This commit is contained in:
Liu
2025-03-19 19:43:40 +08:00
parent 18a2094e8a
commit a60b3c6f3a

View File

@@ -508,7 +508,6 @@ class Robot(Job):
return False
# ============================================== 业务内容==========================================================
@scheduled_job(cron="0 0 8 * * *", name="每日新闻推送")
def news_baidu_report_auto(self) -> None:
try:
news = News().get_baidu_news()
@@ -531,7 +530,6 @@ class Robot(Job):
self.LOG.error(f"newsEnReport error{e}")
# 使用装饰器标记定时任务 星期五 10:30 执行
@scheduled_job(cron="0 30 10 * * 5", name="Epic免费游戏推送")
def send_epic_free_games(self):
try:
if is_friday():
@@ -541,14 +539,12 @@ class Robot(Job):
self.LOG.error(f"sendEpicFreeGames error{e}")
# 使用装饰器标记定时任务
@scheduled_job(cron="0 0 * * * *", name="消息统计入库")
def message_count_to_db(self):
try:
self.message_storage.write_to_db()
except Exception as e:
self.LOG.error(f"write_to_db error{e}")
@scheduled_job(cron="0 0 15 * * *", name="发送色花堂")
def generate_sehuatang_pdf(self):
try:
path = pdf_file_path()
@@ -557,7 +553,6 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"generateSehuatangPdf error{e}")
@scheduled_job(cron="0 30 9 * * *", name="发送消息排行榜")
def generate_and_send_ranking(self):
try:
receivers = self.gbm.get_group_list()
@@ -570,7 +565,6 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"SendRanking error{e}")
# 设置定时任务
@scheduled_job(cron="0 40 19 * * *", name="每天发一个游戏任务")
def game_auto_tasks(self):
try:
group_ids = get_group_ids()
@@ -585,7 +579,6 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"message_summary_robot error{e}")
@scheduled_job(cron="0 30 1 * * *", name="每天下载10组图")
def xiu_ren_download_task(self):
try:
# 每天下载10组图然后发一个帖子PDF
@@ -593,7 +586,6 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"xiu_ren_download_task error{e}")
@scheduled_job(cron="0 30 17 * * *", name="发送秀人PDF")
def xiu_ren_pdf_send(self):
try:
pub_path = generate_pdf_from_images("xiuren")