X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a0ae4945cd60fb395e9d08a8306fb4f7201fa7d1..c7fd0a7af4ce261e61feb0e63d0a6db736280081:/nominatim/tools/check_database.py 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()