mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Define some previously magic numbers
This commit is contained in:
@@ -1511,8 +1511,8 @@ get_ready_archive_files(PGconn *conn, const char *data_directory)
|
||||
log_error(_("unable to access archive_status directory \"%s\""),
|
||||
archive_status_dir);
|
||||
log_detail("%s", strerror(errno));
|
||||
/* XXX magic number */
|
||||
return -1;
|
||||
|
||||
return ARCHIVE_STATUS_DIR_ERROR;
|
||||
}
|
||||
|
||||
arcdir = opendir(archive_status_dir);
|
||||
@@ -1522,8 +1522,8 @@ get_ready_archive_files(PGconn *conn, const char *data_directory)
|
||||
log_error(_("unable to open archive directory \"%s\""),
|
||||
archive_status_dir);
|
||||
log_detail("%s", strerror(errno));
|
||||
/* XXX magic number */
|
||||
return -1;
|
||||
|
||||
return ARCHIVE_STATUS_DIR_ERROR;
|
||||
}
|
||||
|
||||
while ((arcdir_ent = readdir(arcdir)) != NULL)
|
||||
|
||||
@@ -221,19 +221,27 @@ do_node_status(void)
|
||||
|
||||
ready_files = get_ready_archive_files(conn, data_dir);
|
||||
|
||||
if (runtime_options.output_mode == OM_CSV)
|
||||
if (ready_files == ARCHIVE_STATUS_DIR_ERROR)
|
||||
{
|
||||
key_value_list_set_format(&node_status,
|
||||
"WALs pending archiving",
|
||||
"%i",
|
||||
ready_files);
|
||||
item_list_append_format(&warnings,
|
||||
"- unable to check archive_status directory\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
key_value_list_set_format(&node_status,
|
||||
"WALs pending archiving",
|
||||
"%i pending files",
|
||||
ready_files);
|
||||
if (runtime_options.output_mode == OM_CSV)
|
||||
{
|
||||
key_value_list_set_format(&node_status,
|
||||
"WALs pending archiving",
|
||||
"%i",
|
||||
ready_files);
|
||||
}
|
||||
else
|
||||
{
|
||||
key_value_list_set_format(&node_status,
|
||||
"WALs pending archiving",
|
||||
"%i pending files",
|
||||
ready_files);
|
||||
}
|
||||
}
|
||||
|
||||
if (guc_set(conn, "archive_mode", "=", "off"))
|
||||
|
||||
Reference in New Issue
Block a user