Skip to content

Commit

Permalink
Merge pull request #1373 from dragoon/patch-1
Browse files Browse the repository at this point in the history
Allow to actually disable refresh interval
  • Loading branch information
Sam McHardy authored Aug 14, 2024
2 parents 6fa2df4 + dbe41c9 commit 8461579
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions binance/depthcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ def sort_depth(vals, reverse=False, conv_type: Callable = float):
lst = sorted(lst, key=itemgetter(0), reverse=reverse)
return lst

DEFAULT_REFRESH = 60 * 30 # 30 minutes

class BaseDepthCacheManager:
DEFAULT_REFRESH = 60 * 30 # 30 minutes
TIMEOUT = 60

def __init__(self, client, symbol, loop=None, refresh_interval=None, bm=None, limit=10, conv_type=float):
def __init__(self, client, symbol, loop=None, refresh_interval=DEFAULT_REFRESH, bm=None, limit=10, conv_type=float):
"""Create a DepthCacheManager instance
:param client: Binance API client
Expand All @@ -160,7 +160,7 @@ def __init__(self, client, symbol, loop=None, refresh_interval=None, bm=None, li
self._limit = limit
self._last_update_id = None
self._bm = bm or BinanceSocketManager(self._client)
self._refresh_interval = refresh_interval or self.DEFAULT_REFRESH
self._refresh_interval = refresh_interval
self._conn_key = None
self._conv_type = conv_type
self._log = logging.getLogger(__name__)
Expand Down

0 comments on commit 8461579

Please sign in to comment.