Skip to content

Commit 6bfaf24

Browse files
committed
option to use sqlcache
1 parent 725b33e commit 6bfaf24

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pytrackunit/trackunit.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import asyncio
66
import tqdm
77
from .tucache import TuCache
8-
#from .sqlcache import SqlCache
8+
from .sqlcache import SqlCache
99

1010
def get_multi_general(func,idlist,tdelta,f_process=None,progress_bar=True):
1111
"""
@@ -57,8 +57,10 @@ def __init__(self,**kwargs):
5757
if len(api_key) != 32:
5858
raise Exception("Invalid API-key length")
5959
kwargs['auth'] = ('API',api_key)
60-
#self.cache = SqlCache(**kwargs)
61-
self.cache = TuCache(**kwargs)
60+
if kwargs.get('tu_use_sqlcache',False):
61+
self.cache = SqlCache(**kwargs)
62+
else:
63+
self.cache = TuCache(**kwargs)
6264
async def _a_get_unitlist(self,_type=None,sort_by_hours=True):
6365
"""unitList method"""
6466
data = await self.cache.get_unitlist()

0 commit comments

Comments
 (0)