pull数据翻页最大页数不能+1;
This commit is contained in:
@@ -37,13 +37,13 @@ class AppConfig:
|
|||||||
"""应用配置类 - 支持环境变量配置"""
|
"""应用配置类 - 支持环境变量配置"""
|
||||||
|
|
||||||
# 邮箱配置
|
# 邮箱配置
|
||||||
email_account: str = os.getenv("ODDSJAM_EMAIL", "aszer27937@gmail.com")
|
email_account: str = os.getenv("ODDSJAM_EMAIL", "ojbbbb21@proton.me")
|
||||||
|
|
||||||
# 代理配置
|
# 代理配置
|
||||||
http_proxy: str = os.getenv("HTTP_PROXY", "http://127.0.0.1:7890")
|
http_proxy: str = os.getenv("HTTP_PROXY", "http://127.0.0.1:7890")
|
||||||
|
|
||||||
# 数据库表名
|
# 数据库表名
|
||||||
table_name: str = os.getenv("BET_TABLE_NAME", "oddsjam_order_all")
|
table_name: str = os.getenv("BET_TABLE_NAME", "oddsjam_order")
|
||||||
|
|
||||||
# 定时任务配置
|
# 定时任务配置
|
||||||
upload_schedule: str = os.getenv("UPLOAD_SCHEDULE", "09:48")
|
upload_schedule: str = os.getenv("UPLOAD_SCHEDULE", "09:48")
|
||||||
@@ -297,7 +297,7 @@ class OddsjamService:
|
|||||||
logger.info(f"总共 {total_bet_cnt} 条结果,{total_page_no} 页")
|
logger.info(f"总共 {total_bet_cnt} 条结果,{total_page_no} 页")
|
||||||
|
|
||||||
# 翻页到最后一页
|
# 翻页到最后一页
|
||||||
for page_no in range(2, total_page_no + 1):
|
for page_no in range(2, total_page_no):
|
||||||
if page_no <= total_page_no:
|
if page_no <= total_page_no:
|
||||||
expect(page.get_by_role("button", name="Next")).to_be_visible(
|
expect(page.get_by_role("button", name="Next")).to_be_visible(
|
||||||
timeout=self.config.default_timeout
|
timeout=self.config.default_timeout
|
||||||
@@ -433,7 +433,7 @@ class TaskScheduler:
|
|||||||
self.data_processor = BetDataProcessor(config)
|
self.data_processor = BetDataProcessor(config)
|
||||||
|
|
||||||
def upload_bets_task(self, date_str: Optional[str] = None) -> None:
|
def upload_bets_task(self, date_str: Optional[str] = None) -> None:
|
||||||
"""上传投注数据任务"""
|
"""上传 T-1 时间的投注数据任务"""
|
||||||
config_base_info = str(self.config)
|
config_base_info = str(self.config)
|
||||||
try:
|
try:
|
||||||
if date_str is None:
|
if date_str is None:
|
||||||
@@ -455,14 +455,14 @@ class TaskScheduler:
|
|||||||
|
|
||||||
# 发送通知
|
# 发送通知
|
||||||
self.config.dingtalk.send_text(
|
self.config.dingtalk.send_text(
|
||||||
f"{date_str}: \n {config_base_info} \n {data_info}"
|
f"{date_str}:比赛数据上传完成\n{config_base_info}\n{data_info}"
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error_info = traceback.format_exc()
|
error_info = traceback.format_exc()
|
||||||
logger.error(f"上传任务失败: {error_info}")
|
logger.error(f"上传任务失败: {error_info}")
|
||||||
self.config.dingtalk.send_text(
|
self.config.dingtalk.send_text(
|
||||||
f"{date_str}: \n {config_base_info} \n 上传比赛失败: {e}\n{error_info}"
|
f"{date_str}:\n{config_base_info}\n上传比赛失败: {e}\n{error_info}"
|
||||||
)
|
)
|
||||||
|
|
||||||
def pull_status_task(self, date_str: Optional[str] = None) -> None:
|
def pull_status_task(self, date_str: Optional[str] = None) -> None:
|
||||||
@@ -554,3 +554,7 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
# app = BetTrackerApplication()
|
||||||
|
# logger.info(app.config)
|
||||||
|
# app.run_manual_task(task_type="upload", date_str="20251026")
|
||||||
|
|||||||
Reference in New Issue
Block a user