diff --git a/analysisstore/server/astore.py b/analysisstore/server/astore.py index ea984e0..9bf17f7 100644 --- a/analysisstore/server/astore.py +++ b/analysisstore/server/astore.py @@ -20,6 +20,7 @@ def __init__(self, config, testing=False): if not testing: try: self.client = MongoClient(config["uri"]) + # Proactively check that connection to server is working. self.client.server_info() except (pymongo.errors.ConnectionFailure, pymongo.errors.ServerSelectionTimeoutError): raise AnalysisstoreException("Unable to connect to MongoDB server...")