mirror of
https://github.com/norohind/jubilant-system.git
synced 2025-04-23 17:20:27 +03:00
TIME_BETWEEN_REQUESTS as global var
This commit is contained in:
parent
c3dd483e23
commit
a8007659cd
6
utils.py
6
utils.py
@ -16,6 +16,9 @@ BASE_URL = 'https://api.orerve.net/2.0/website/squadron/'
|
||||
INFO_ENDPOINT = 'info'
|
||||
NEWS_ENDPOINT = 'news/list'
|
||||
|
||||
TIME_BETWEEN_REQUESTS: float = float(os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS")) or 3.0
|
||||
logger.debug(f'TIME_BETWEEN_REQUESTS = {TIME_BETWEEN_REQUESTS} {type(TIME_BETWEEN_REQUESTS)}')
|
||||
|
||||
with open('available.json', 'r', encoding='utf-8') as available_file:
|
||||
TAG_COLLECTIONS: dict = json.load(available_file)['SquadronTagData']['SquadronTagCollections']
|
||||
|
||||
@ -54,9 +57,6 @@ def proxied_request(url: str, method: str = 'get', **kwargs) -> requests.Respons
|
||||
|
||||
global PROXIES_DICT
|
||||
|
||||
TIME_BETWEEN_REQUESTS: float = float(os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS")) or 3.0
|
||||
logger.debug(f'TIME_BETWEEN_REQUESTS = {TIME_BETWEEN_REQUESTS} {type(TIME_BETWEEN_REQUESTS)}')
|
||||
|
||||
while True:
|
||||
|
||||
selected_proxy = min(PROXIES_DICT, key=lambda x: x['last_try'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user