Don't forward errors without an order id

basic_orders
Tyler Goodlet 2021-02-22 10:45:01 -05:00
parent af82f36bd8
commit 1142a538ea
1 changed files with 9 additions and 2 deletions

View File

@ -23,13 +23,14 @@ built on it) and thus actor aware API calls must be spawned with
""" """
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from dataclasses import asdict from dataclasses import asdict
from functools import partial
from datetime import datetime from datetime import datetime
from functools import partial
from typing import List, Dict, Any, Tuple, Optional, AsyncIterator, Callable from typing import List, Dict, Any, Tuple, Optional, AsyncIterator, Callable
import asyncio import asyncio
import logging from pprint import pformat
import inspect import inspect
import itertools import itertools
import logging
import time import time
import trio import trio
@ -1216,4 +1217,10 @@ async def stream_trades(
if isinstance(con, Contract): if isinstance(con, Contract):
msg['contract'] = asdict(con) msg['contract'] = asdict(con)
if msg['reqid'] == -1:
log.error(pformat(msg))
# don't forward, it's pointless..
continue
yield {'local_trades': (event_name, msg)} yield {'local_trades': (event_name, msg)}