Skip to content

Commit

Permalink
cache get_account_type because it is god damn slow
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricporter committed Apr 5, 2017
1 parent 5ce0717 commit 88a3ec2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rqalpha/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from ..utils.datetime_func import TimeRange
from ..utils.default_future_info import STOCK_TRADING_PERIOD, TRADING_PERIOD_DICT
from ..utils.i18n import gettext as _
from ..utils.py2 import lru_cache


def safe_round(value, ndigits=3):
Expand Down Expand Up @@ -213,6 +214,7 @@ def instrument_type_str2enum(type_str):
]


@lru_cache(None)
def get_account_type(order_book_id):
from ..environment import Environment
instrument = Environment.get_instance().get_instrument(order_book_id)
Expand Down

0 comments on commit 88a3ec2

Please sign in to comment.