This commit is contained in:
27942
2026-02-28 13:10:47 +08:00
parent 2e0a2bc74f
commit c45017dcf4
16 changed files with 137922 additions and 7 deletions

View File

@@ -90,7 +90,7 @@ class BBTrader:
self.page: ChromiumPage | None = None
self.page_start = True # 需要(重新)打开浏览器
self.last_page_open_time = 0.0 # 上次打开浏览器的时间
self.PAGE_REFRESH_INTERVAL = 180 # 每3分钟关闭重开浏览器
self.PAGE_REFRESH_INTERVAL = 1800 # 每30分钟关闭重开浏览器
# 持仓状态: -1=空, 0=无, 1=多
self.position = 0
@@ -394,9 +394,9 @@ class BBTrader:
page_start = False
try:
# 每3分钟关闭浏览器重新打开
# 每30分钟关闭浏览器重新打开
if time.time() - self.last_page_open_time >= self.PAGE_REFRESH_INTERVAL:
logger.info("浏览器已打开超过3分钟关闭刷新")
logger.info("浏览器已打开超过30分钟,关闭刷新")
try:
self.page.close()
except Exception: