added config options sleep_delay and sleep_monitor

sleep_monitor replaces the old SLEEP_MONITOR define and makes it
configurable; this is the interval in which we monitor

sleep_delay replaces the old sleep(300) when waiting for the master to
recover.
This commit is contained in:
Christian Kruse
2014-01-17 13:50:12 +01:00
parent a7d3c9b93a
commit 5fc4a0382f
5 changed files with 30 additions and 9 deletions

View File

@@ -52,6 +52,9 @@ parse_config(const char *config_file, t_configuration_options *options)
options->reconnect_attempts = 6;
options->reconnect_intvl = 10;
options->sleep_monitor = 2;
options->sleep_delay = 300;
/*
* Since some commands don't require a config file at all, not
* having one isn't necessarily a problem.
@@ -122,6 +125,10 @@ parse_config(const char *config_file, t_configuration_options *options)
strncpy (options->pgctl_options, value, MAXLEN);
else if (strcmp(name, "logfile") == 0)
strncpy(options->logfile, value, MAXLEN);
else if (strcmp(name, "sleep_monitor") == 0)
options->sleep_monitor = atoi(value);
else if (strcmp(name, "sleep_delay") == 0)
options->sleep_delay = atoi(value);
else
log_warning(_("%s/%s: Unknown name/value pair!\n"), name, value);
}