mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
polygon symbol handling edge case
This commit is contained in:
@@ -705,7 +705,8 @@ def send_message(
|
||||
else:
|
||||
client.logger.error("Broadcast process is not running.")
|
||||
except Exception as e:
|
||||
client.logger.error(f"Error sending message to WebSocket process: {e}")
|
||||
msg = f"Error sending message to WebSocket process: {e.__class__.__name__} -> {e.__str__()}"
|
||||
client.logger.error(msg)
|
||||
|
||||
|
||||
def read_message_queue(
|
||||
|
||||
@@ -57,9 +57,9 @@ async def create_connection(
|
||||
|
||||
await asyncio.sleep(1)
|
||||
|
||||
if not client.is_running:
|
||||
if client._exception:
|
||||
exc = getattr(client, "_exception", None)
|
||||
if not client.is_running or client._exception:
|
||||
exc = getattr(client, "_exception", None)
|
||||
if exc:
|
||||
client._atexit()
|
||||
if isinstance(exc, UnauthorizedError):
|
||||
raise exc
|
||||
|
||||
@@ -65,9 +65,9 @@ async def handle_symbol(symbol):
|
||||
if ticker and "." not in ticker:
|
||||
ticker = f"{feed}.{ticker}"
|
||||
|
||||
if ASSET_TYPE == "crypto" and "-" not in ticker and ticker != "*":
|
||||
if ASSET_TYPE == "crypto" and "-" not in ticker and "*" not in ticker:
|
||||
ticker = ticker[:3] + "-" + ticker[3:]
|
||||
elif ASSET_TYPE == "fx" and "/" not in ticker and ticker != "*":
|
||||
elif ASSET_TYPE == "fx" and "/" not in ticker and "*" not in ticker:
|
||||
ticker = ticker[:3] + "/" + ticker[3:]
|
||||
elif ASSET_TYPE == "fx" and "-" in ticker:
|
||||
ticker = ticker.replace("-", "/")
|
||||
|
||||
Reference in New Issue
Block a user