Skip to content

Commit

Permalink
removed the extra debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodlz committed Jun 23, 2023
1 parent 4449e28 commit 0c1bf30
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion kowalski/tests/test_ingester_wntr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class TestIngester:
""" """

def test_ingester(self):
log("Starting the ingester test")
init_db_sync(config=config, verbose=True)

log("Setting up paths")
Expand Down
12 changes: 0 additions & 12 deletions kowalski/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ def init_db_sync(config, verbose=False):
"""
Initialize db if necessary: create the sole non-admin user
"""
if verbose:
log("Initializing db...")
if config["database"].get("srv, False") is True:
conn_string = "mongodb+srv://"
else:
Expand All @@ -235,16 +233,10 @@ def init_db_sync(config, verbose=False):
if config["database"]["replica_set"] is not None:
conn_string += f"/?replicaSet={config['database']['replica_set']}"

if verbose:
log(f"Connecting to {conn_string}")
client = pymongo.MongoClient(conn_string)
if verbose:
log("Connected to db")

# to fix: on srv (like atlas) we can't do this
if config["database"].get("srv", False) is not True:
if verbose:
log("Initializing db users...")
user_ids = []
for _u in client.admin.system.users.find({}, {"_id": 1}):
user_ids.append(_u["_id"])
Expand All @@ -264,11 +256,7 @@ def init_db_sync(config, verbose=False):
if verbose:
log("Successfully initialized db")

if verbose:
log("Closing connection to db...")
_mongo.client.close()
if verbose:
log("Connection closed")


async def add_admin(_mongo, config):
Expand Down

0 comments on commit 0c1bf30

Please sign in to comment.