use TTLCache for get_ticker_history
This commit is contained in:
@@ -4,6 +4,7 @@ from random import randint
|
||||
from typing import List, Dict, Any, Optional
|
||||
|
||||
import arrow
|
||||
from cachetools import cached, TTLCache
|
||||
|
||||
from freqtrade.exchange.bittrex import Bittrex
|
||||
from freqtrade.exchange.interface import Exchange
|
||||
@@ -127,6 +128,7 @@ def get_ticker(pair: str) -> dict:
|
||||
return _API.get_ticker(pair)
|
||||
|
||||
|
||||
@cached(TTLCache(maxsize=100, ttl=30))
|
||||
def get_ticker_history(pair: str, tick_interval: Optional[int] = 5) -> List:
|
||||
return _API.get_ticker_history(pair, tick_interval)
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class Bittrex(Exchange):
|
||||
_API = _Bittrex(
|
||||
api_key=_EXCHANGE_CONF['key'],
|
||||
api_secret=_EXCHANGE_CONF['secret'],
|
||||
calls_per_second=5,
|
||||
calls_per_second=3,
|
||||
)
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user