do not init storage before first used

This commit is contained in:
Emmanuel Garette 2019-12-08 08:15:14 +01:00
parent d9c0b18404
commit d958b9dfad
1 changed files with 3 additions and 1 deletions

View File

@ -47,11 +47,13 @@ class Storage:
**kwargs: Dict[str, str]) -> None:
self.storage_type = None
self.mod = None
if kwargs:
self.setting(**kwargs)
def get(self):
if self.storage_type is None:
self.storage_type = environ.get('TIRAMISU_STORAGE', DEFAULT_STORAGE)
self.setting()
if self.mod is None:
modulepath = '{0}.storage.{1}'.format(MODULE_PATH,
self.storage_type)