Add sleep
This commit is contained in:
parent
fca29a7bff
commit
7431f44804
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ from typing import Dict, Tuple, List
|
|||
import requests
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
|
||||
from compLib.LogstashLogging import Logging
|
||||
|
||||
|
@ -87,6 +88,7 @@ class DoubleElim:
|
|||
res = requests.get(API_URL_GET_POS)
|
||||
if res.status_code == 408:
|
||||
Logging.get_logger().error(f"DoubleElim.get_position timeout!")
|
||||
time.sleep(0.01)
|
||||
return get_position()
|
||||
|
||||
response = json.loads(res.content)
|
||||
|
@ -103,6 +105,7 @@ class DoubleElim:
|
|||
res = requests.get(API_URL_GET_OP)
|
||||
if res.status_code == 408:
|
||||
Logging.get_logger().error(f"DoubleElim.get_opponent timeout!")
|
||||
time.sleep(0.01)
|
||||
return get_opponent()
|
||||
|
||||
response = json.loads(res.content)
|
||||
|
@ -119,6 +122,7 @@ class DoubleElim:
|
|||
res = requests.get(API_URL_GET_GOAL)
|
||||
if res.status_code == 408:
|
||||
Logging.get_logger().error(f"DoubleElim.get_goal timeout!")
|
||||
time.sleep(0.01)
|
||||
return get_goal()
|
||||
|
||||
response = json.loads(res.content)
|
||||
|
@ -135,6 +139,7 @@ class DoubleElim:
|
|||
res = requests.get(API_URL_GET_ITEMS)
|
||||
if res.status_code == 408:
|
||||
Logging.get_logger().error(f"DoubleElim.get_items timeout!")
|
||||
time.sleep(0.01)
|
||||
return get_items()
|
||||
|
||||
response = json.loads(res.content)
|
||||
|
@ -151,6 +156,7 @@ class DoubleElim:
|
|||
res = requests.get(API_URL_GET_SCORES)
|
||||
if res.status_code == 408:
|
||||
Logging.get_logger().error(f"DoubleElim.get_scores timeout!")
|
||||
time.sleep(0.01)
|
||||
return get_scores()
|
||||
|
||||
response = json.loads(res.content)
|
||||
|
|
Reference in a new issue