测试jobs

This commit is contained in:
liuwei
2025-05-20 10:34:17 +08:00
parent 9592d57b0c
commit 5dfb743a01
2 changed files with 91 additions and 86 deletions

54
main.py
View File

@@ -50,7 +50,7 @@ def main():
else:
robot.LOG.error("wechat_ipad客户端启动失败")
# 注册定时任务
# jobs(robot)
jobs(robot)
# 启动Dashboard服务器
dashboard_server = None
try:
@@ -70,29 +70,35 @@ def main():
robot.keep_running_and_block_process()
# def jobs(robot: Robot):
# # # 每天 8:30 发送新闻
# robot.onEveryTime("08:30", robot.news_baidu_report_auto)
# #
# # # epic
# robot.onEveryTime("10:30", robot.send_epic_free_games)
# #
# # # message report 1:数据自动从redis 转到sqllite
# robot.onEveryTime("02:30", robot.message_count_to_db)
# # # 从db中提取并发送给相关群
# robot.onEveryTime("09:30", robot.generate_and_send_ranking)
# #
# # # sehuatang
# robot.onEveryTime("15:30", robot.generate_sehuatang_pdf)
# #
# # # 秀人网每天自动下载帖子
# robot.onEveryTime("01:30", robot.xiu_ren_download_task)
# #
# # # 秀人网每天自动发pdf
# # robot.onEveryTime("17:30", robot.xiu_ren_pdf_send)
#
# # 每天进行二次登录检查
# robot.onEveryHours(3, robot.login_twice_auto_auth)
def jobs(robot: Robot):
# # 每天 8:30 发送新闻
@async_job.at_times(["08:30"])
async def news_baidu_report_auto_job():
await robot.news_baidu_report_auto()
@async_job.at_times(["10:36"])
async def test_job():
await robot.job_test()
# #
# # # epic
# robot.onEveryTime("10:30", robot.send_epic_free_games)
# #
# # # message report 1:数据自动从redis 转到sqllite
# robot.onEveryTime("02:30", robot.message_count_to_db)
# # # 从db中提取并发送给相关群
# robot.onEveryTime("09:30", robot.generate_and_send_ranking)
# #
# # # sehuatang
# robot.onEveryTime("15:30", robot.generate_sehuatang_pdf)
# #
# # # 秀人网每天自动下载帖子
# robot.onEveryTime("01:30", robot.xiu_ren_download_task)
# #
# # # 秀人网每天自动发pdf
# # robot.onEveryTime("17:30", robot.xiu_ren_pdf_send)
#
# # 每天进行二次登录检查
# robot.onEveryHours(3, robot.login_twice_auto_auth)
if __name__ == "__main__":