X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a0ae4945cd60fb395e9d08a8306fb4f7201fa7d1..7a874d5b97f65dc1f5a267fd53cc73c2cd5246b6:/nominatim/tools/check_database.py?ds=sidebyside diff --git a/nominatim/tools/check_database.py b/nominatim/tools/check_database.py index 3031026b..d8ab08cc 100644 --- a/nominatim/tools/check_database.py +++ b/nominatim/tools/check_database.py @@ -60,7 +60,7 @@ def check_database(config): """ Run a number of checks on the database and return the status. """ try: - conn = connect(config.get_libpq_dsn()) + conn = connect(config.get_libpq_dsn()).connection except UsageError as err: conn = _BadConnection(str(err)) @@ -70,7 +70,7 @@ def check_database(config): if ret == CheckState.FATAL: conn.close() return 1 - if ret != CheckState.OK: + if ret in (CheckState.FATAL, CheckState.FAIL): overall_result = 1 conn.close()