Creates a health-check function that queries the database to verify connectivity.
The check times out and rejects if the database does not respond within the allotted time.
Parameters
connection: Pool
The pg.Pool to query.
dbConnectionTimeout: number = DEFAULT_DB_CONNECTION_TIMEOUT
Maximum milliseconds to wait before treating the check as failed. Defaults to 5000.
Returns ()=>Promise<void>
An async function that resolves when the database is reachable, or rejects on timeout / error.
Creates a health-check function that queries the database to verify connectivity. The check times out and rejects if the database does not respond within the allotted time.