From 06863aafda832a724cfdbaeea27c25b42ab49158 Mon Sep 17 00:00:00 2001 From: Seany519 <83579121+Seanman519@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:09:02 +0000 Subject: [PATCH] Update extractor.py --- rlbot/data/extractor.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/rlbot/data/extractor.py b/rlbot/data/extractor.py index 09a72e7..8f55120 100644 --- a/rlbot/data/extractor.py +++ b/rlbot/data/extractor.py @@ -1,4 +1,3 @@ -"""Function related to extract data from 3rd party and data stores.""" from __future__ import annotations import _pickle as cPickle @@ -6,10 +5,10 @@ import pandas as pd import requests -from rlbot.utils.configs.constants import mt5_api_port_map -from rlbot.utils.configs.constants import mt5_creds -from rlbot.utils.logging import get_logger -from rlbot.workflows.service_manager import start_mt5_api +from releat.utils.configs.constants import mt5_api_port_map +from releat.utils.configs.constants import mt5_creds +from releat.utils.logging import get_logger +from releat.workflows.service_manager import start_mt5_api logger = get_logger(__name__) @@ -41,16 +40,16 @@ def download_tick_data(broker, symbol, dt0, dt1, data_mode, check_api=True, time """ port = mt5_api_port_map[broker][symbol] if check_api: - resp = requests.get(f"http://127.0.0.1:{port}/healthcheck") + resp = requests.get(f"http://127.0.0.1:2000/healthcheck") if resp.status_code != 200: - logger.warning(f"Connection error to port {port}. Initializing...") + logger.warning(f"Connection error to port 2000. Initializing...") start_mt5_api(broker, symbol) - resp = requests.get(f"http://127.0.0.1:{port}/healthcheck") - assert resp.stats_code == 200, f"http://127.0.0.1:{port} failed to initialize" + resp = requests.get(f"http://127.0.0.1:2000/healthcheck") + assert resp.stats_code == 200, f"http://127.0.0.1:2000 failed to initialize" mt5_config = mt5_creds[broker][data_mode] - resp = requests.post(f"http://127.0.0.1:{port}/init", json=mt5_config) - logger.info(f"Connection success to port {port}") + resp = requests.post(f"http://127.0.0.1:2000/init", json=mt5_config) + logger.info(f"Connection success to port 2000") dt0 = dt0.strftime("%Y-%m-%d %H:%M:%S.%f") dt1 = dt1.strftime("%Y-%m-%d %H:%M:%S.%f") @@ -62,7 +61,7 @@ def download_tick_data(broker, symbol, dt0, dt1, data_mode, check_api=True, time } resp = requests.get( - f"http://127.0.0.1:{port}/get_tick_data", + f"http://127.0.0.1:2000/get_tick_data", json=d_request, timeout=timeout, )