Delay initializition of the MongoKeyStore until required
This commit is contained in:
committed by
Matthew Mongeau
parent
d8d22ea57b
commit
86205c21ff
@@ -9,4 +9,13 @@ from __future__ import absolute_import
|
||||
from django.conf import settings
|
||||
from .mongo import MongoKeyStore
|
||||
|
||||
keystore = MongoKeyStore(**settings.KEYSTORE)
|
||||
_KEYSTORE = None
|
||||
|
||||
|
||||
def keystore():
|
||||
global _KEYSTORE
|
||||
|
||||
if _KEYSTORE is None:
|
||||
_KEYSTORE = MongoKeyStore(**settings.KEYSTORE)
|
||||
|
||||
return _KEYSTORE
|
||||
|
||||
Reference in New Issue
Block a user