Commit 77b45967 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.6.4' into 'master'

Applied mongo connection fix.

See merge request !70
parents 83b65f15 95c33501
Pipeline #65667 passed with stage
in 32 seconds
......@@ -28,7 +28,8 @@ from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from elasticsearch.exceptions import RequestError
from elasticsearch_dsl import connections
from mongoengine import connect
from mongoengine import connect, disconnect
from mongoengine.connection import MongoEngineConnectionError
from passlib.hash import bcrypt
import smtplib
from email.mime.text import MIMEText
......@@ -80,7 +81,12 @@ def setup_logging():
def setup_mongo():
""" Creates connection to mongodb. """
global mongo_client
mongo_client = connect(db=config.mongo.db_name,, port=config.mongo.port)
mongo_client = connect(db=config.mongo.db_name,, port=config.mongo.port)
except MongoEngineConnectionError:
mongo_client = connect(db=config.mongo.db_name,, port=config.mongo.port)'setup mongo connection')
return mongo_client
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment