1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Add local option for cfgExecParam().

cfgExecParam() was originally written to provide options for remote processes.  Remotes processes do not have access to the local config so it was necessary to pass every non-default option.

Local processes on the other hand, e.g. archive-get, archive-get-async, archive-push-async, and local, do have access to the local config and therefore don't need every parameter to be passed on the command-line.  The previous way was not wrong, but it was overly verbose and did not align with the way Perl had worked.

Update cfgExecParam() to accept a local option which excludes options from the command line which can be read from local configs.
This commit is contained in:
David Steele
2019-09-20 17:50:49 -04:00
parent 3f18040aab
commit 5b64c93e8b
6 changed files with 13 additions and 9 deletions

View File

@ -299,7 +299,7 @@ cmdArchivePush(void)
kvPut(optionReplace, VARSTR(CFGOPT_LOG_LEVEL_STDERR_STR), VARSTRDEF("off"));
// Generate command options
StringList *commandExec = cfgExecParam(cfgCmdArchivePushAsync, optionReplace);
StringList *commandExec = cfgExecParam(cfgCmdArchivePushAsync, optionReplace, true);
strLstInsert(commandExec, 0, cfgExe());
strLstAdd(commandExec, strPath(walFile));