mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
get_all_node_records(): display any error encountered and return success status
In many cases we'll want to bail out with an error if the node list can't be retrieved for any reason. This saves some repetitive coding.
This commit is contained in:
@@ -150,7 +150,13 @@ monitor_bdr(void)
|
||||
* retrieve list of all nodes - we'll need these if the DB connection goes
|
||||
* away
|
||||
*/
|
||||
get_all_node_records(local_conn, &nodes);
|
||||
if (get_all_node_records(local_conn, &nodes) == false)
|
||||
{
|
||||
/* get_all_node_records() will display the error */
|
||||
PQfinish(local_conn);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
|
||||
/* we're expecting all (both) nodes to be up */
|
||||
for (cell = nodes.head; cell; cell = cell->next)
|
||||
|
||||
Reference in New Issue
Block a user