rgfewfger
This commit is contained in:
@@ -319,6 +319,7 @@ class WeexTransaction:
|
||||
|
||||
self.pbar = tqdm(total=30, desc="等待时间中", ncols=80) # desc:进度条说明,ncols:长度
|
||||
|
||||
self.time_start = None # 时间状态 避免同一个时段,发生太多消息
|
||||
while True:
|
||||
# 获取当前时间
|
||||
current_time = time.localtime()
|
||||
@@ -350,6 +351,11 @@ class WeexTransaction:
|
||||
if self.get_now_time() != self.kline_3["id"]:
|
||||
continue
|
||||
|
||||
if self.time_start == self.get_now_time():
|
||||
continue
|
||||
|
||||
self.time_start = self.get_now_time()
|
||||
|
||||
if self.get_token(): # 获取token
|
||||
logger.info("获取token成功!!!")
|
||||
else:
|
||||
|
||||
@@ -322,6 +322,7 @@ class WeexTransaction:
|
||||
|
||||
self.pbar = tqdm(total=30, desc="等待时间中", ncols=80) # desc:进度条说明,ncols:长度
|
||||
|
||||
self.time_start = None # 时间状态 避免同一个时段,发生太多消息
|
||||
while True:
|
||||
# 获取当前时间
|
||||
current_time = time.localtime()
|
||||
@@ -335,7 +336,7 @@ class WeexTransaction:
|
||||
self.pbar.refresh()
|
||||
|
||||
if current_minute not in [0, 1, 2, 3, 4, 5, 30, 31, 32, 33, 34, ]: # 判断是否是 新的30分钟了
|
||||
# if current_minute not in range(60): # 判断是否是 新的30分钟了
|
||||
# if current_minute not in range(60): # 判断是否是 新的30分钟了
|
||||
time.sleep(10)
|
||||
continue
|
||||
|
||||
@@ -359,6 +360,10 @@ class WeexTransaction:
|
||||
# 判断抓取的数据是否正确
|
||||
if self.get_now_time() != self.kline_3["id"]:
|
||||
continue
|
||||
if self.time_start == self.get_now_time():
|
||||
continue
|
||||
|
||||
self.time_start = self.get_now_time()
|
||||
|
||||
if self.get_position_status():
|
||||
logger.info("获取仓位信息成功!!!")
|
||||
|
||||
Reference in New Issue
Block a user