""" 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))
if ret == CheckState.FATAL:
conn.close()
return 1
- if ret != CheckState.OK:
+ if ret in (CheckState.FATAL, CheckState.FAIL):
overall_result = 1
conn.close()
return CheckState.OK if cnt > 0 else CheckState.FATAL
+
@_check(hint="""\
The Postgresql extension nominatim.so was not correctly loaded.
# Likely just an interrupted update.
index_cmd = 'nominatim index'
else:
- # Looks like the import process got interupted.
+ # Looks like the import process got interrupted.
index_cmd = 'nominatim import --continue indexing'
return CheckState.FAIL, dict(count=cnt, index_cmd=index_cmd)
-
@_check(hint="""\
The following indexes are missing:
{indexes}