mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-14 10:13:05 +02:00
Fixed restore::thread-max
This commit is contained in:
parent
0c9da6a5ab
commit
267efbd71d
@ -447,11 +447,11 @@ if (operation_get() eq OP_RESTORE)
|
||||
# Do the restore
|
||||
new BackRest::Restore
|
||||
(
|
||||
config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_PATH),
|
||||
config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_PATH, true),
|
||||
param_get(PARAM_SET),
|
||||
config_section_load(CONFIG_SECTION_TABLESPACE_MAP),
|
||||
$oFile,
|
||||
undef, #param_get(PARAM_THREAD),
|
||||
config_key_load(CONFIG_SECTION_RESTORE, CONFIG_KEY_THREAD_MAX, true),
|
||||
param_get(PARAM_DELTA),
|
||||
param_get(PARAM_FORCE),
|
||||
param_get(PARAM_TYPE),
|
||||
|
@ -345,6 +345,26 @@ sub config_key_load
|
||||
return $strValue;
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
# CONFIG_KEY_SET
|
||||
####################################################################################################################################
|
||||
sub config_key_set
|
||||
{
|
||||
my $strSection = shift;
|
||||
my $strKey = shift;
|
||||
my $strValue = shift;
|
||||
|
||||
# Make sure all parameters are defined
|
||||
if (!defined($strSection) || !defined($strKey) || !defined($strValue))
|
||||
{
|
||||
confess &log(ASSERT, 'section, key and value must all be defined');
|
||||
}
|
||||
|
||||
# Set the value
|
||||
$strSection = param_get(PARAM_STANZA) . ':' . $strSection;
|
||||
|
||||
$oConfig{$strSection}{$strKey} = $strValue;
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
# CONFIG_VALID
|
||||
@ -357,7 +377,7 @@ sub config_valid
|
||||
my $strSection;
|
||||
my $oSectionHashRef;
|
||||
|
||||
# Check recovery:option section
|
||||
# Check [stanza]:recovery:option section
|
||||
$strSection = param_get(PARAM_STANZA) . ':' . CONFIG_SECTION_RECOVERY_OPTION;
|
||||
$oSectionHashRef = $oConfig{$strSection};
|
||||
|
||||
@ -379,6 +399,18 @@ sub config_valid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Default thread-max
|
||||
if (!defined(config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_THREAD_MAX)))
|
||||
{
|
||||
config_key_set(CONFIG_SECTION_BACKUP, CONFIG_KEY_THREAD_MAX, 1);
|
||||
}
|
||||
|
||||
if (!defined(config_key_load(CONFIG_SECTION_RESTORE, CONFIG_KEY_THREAD_MAX)))
|
||||
{
|
||||
config_key_set(CONFIG_SECTION_RESTORE, CONFIG_KEY_THREAD_MAX,
|
||||
config_key_load(CONFIG_SECTION_BACKUP, CONFIG_KEY_THREAD_MAX, true));
|
||||
}
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user