mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
better handle connection errors to db
This commit is contained in:
parent
da23775c25
commit
b9a6e093ab
1 changed files with 9 additions and 1 deletions
10
start.py
10
start.py
|
|
@ -100,6 +100,8 @@ import subprocess
|
||||||
import site
|
import site
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from pymongo.errors import ServerSelectionTimeoutError
|
||||||
|
|
||||||
# add dependencies folder to sys.pat for frozen code
|
# add dependencies folder to sys.pat for frozen code
|
||||||
if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
frozen_libs = os.path.normpath(
|
frozen_libs = os.path.normpath(
|
||||||
|
|
@ -569,7 +571,13 @@ def boot():
|
||||||
|
|
||||||
# Get Pype path from database and set it to environment so Pype can
|
# Get Pype path from database and set it to environment so Pype can
|
||||||
# find its versions there and bootstrap them.
|
# find its versions there and bootstrap them.
|
||||||
pype_path = get_pype_path_from_db(pype_mongo)
|
try:
|
||||||
|
pype_path = get_pype_path_from_db(pype_mongo)
|
||||||
|
except ServerSelectionTimeoutError as e:
|
||||||
|
print("!!! Can't connect to mongodb database server.")
|
||||||
|
print("!!! {}".format(e))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if not os.getenv("PYPE_PATH") and pype_path:
|
if not os.getenv("PYPE_PATH") and pype_path:
|
||||||
os.environ["PYPE_PATH"] = pype_path
|
os.environ["PYPE_PATH"] = pype_path
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue