Skip to content

Commit

Permalink
use a more-favored function call to check client connection
Browse files Browse the repository at this point in the history
 * more questions online about checking status use
   server_info() than other functions on the mongo client
  • Loading branch information
JunAishima committed Mar 6, 2024
1 parent 29b711e commit bb4d1e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conftrak/server/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def db_connect(database, mongo_uri, testing=False):
else:
try:
client = pymongo.MongoClient(mongo_uri)
client.list_database_names() # check if the server is really okay.
client.server_info() # check if the server is really okay.
except (
pymongo.errors.ConnectionFailure,
pymongo.errors.ServerSelectionTimeoutError,
Expand Down

0 comments on commit bb4d1e3

Please sign in to comment.