Initial primary node monitoring

This commit is contained in:
Ian Barwick
2017-06-27 00:15:29 +09:00
parent 7845a1fb47
commit 78a16d746d
3 changed files with 85 additions and 3 deletions

View File

@@ -2177,3 +2177,15 @@ wait_connection_availability(PGconn *conn, long long timeout)
return -1;
}
/* node availability functions */
bool
is_server_available(const char *conninfo)
{
PGPing status = PQping(conninfo);
if (status == PQPING_OK)
return true;
return false;
}