mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
default mongo url is accessible with method
This commit is contained in:
parent
f2ecff2688
commit
355872938b
1 changed files with 5 additions and 1 deletions
|
|
@ -137,10 +137,14 @@ class PypeMongoConnection:
|
|||
mongo_clients = {}
|
||||
log = logging.getLogger("PypeMongoConnection")
|
||||
|
||||
@staticmethod
|
||||
def get_default_mongo_url():
|
||||
return os.environ["PYPE_MONGO"]
|
||||
|
||||
@classmethod
|
||||
def get_mongo_client(cls, mongo_url=None):
|
||||
if mongo_url is None:
|
||||
mongo_url = os.environ["PYPE_MONGO"]
|
||||
mongo_url = cls.get_default_mongo_url()
|
||||
|
||||
connection = cls.mongo_clients.get(mongo_url)
|
||||
if connection:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue