Skip to content

Commit

Permalink
Migrated many functions from File.pm to FileCommon.pm.
Browse files Browse the repository at this point in the history
This makes make the migrated file functions available to parts of the code that don't have access to a File object.  They still exist as wrappers in the File object to support remote calls.
  • Loading branch information
dwsteele committed Apr 13, 2016
1 parent be8487d commit 885797e
Show file tree
Hide file tree
Showing 34 changed files with 2,639 additions and 4,015 deletions.
2 changes: 1 addition & 1 deletion doc/lib/BackRestDoc/Common/DocRender.pm
Expand Up @@ -130,7 +130,7 @@ my $oRenderTag =
'code' => ['<span class="id">', '</span>'],
'code-block' => ['<code-block>', '</code-block>'],
'exe' => [undef, ''],
'setting' => ['<span class="br-setting">', '</span>'], # !!! This will need to be fixed
'setting' => ['<span class="br-setting">', '</span>'], # ??? This will need to be fixed
'backrest' => [undef, ''],
'postgres' => ['<span class="postgres">PostgreSQL</span>', '']
}
Expand Down
2 changes: 1 addition & 1 deletion doc/xml/user-guide.xml
Expand Up @@ -551,7 +551,7 @@
<exe-cmd>chmod 550 {[backrest-repo-path]}/temp</exe-cmd>
</execute>

<execute output="y" err-expect="199">
<execute output="y" err-expect="122">
<exe-cmd>{[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} {[dash]}-type=incr
--log-level-console=info backup</exe-cmd>
<exe-highlight>ERROR:</exe-highlight>
Expand Down
5 changes: 2 additions & 3 deletions lib/BackRest/Backup.pm
Expand Up @@ -27,6 +27,7 @@ use BackRest::Common::String;
use BackRest::Config::Config;
use BackRest::Db;
use BackRest::File;
use BackRest::FileCommon;
use BackRest::Manifest;

####################################################################################################################################
Expand Down Expand Up @@ -355,9 +356,7 @@ sub tmpClean
else
{
logDebugMisc($strOperation, "remove file ${strDelete}");

unlink($strDelete)
or confess &log(ERROR, "unable to delete file ${strDelete}", ERROR_FILE_REMOVE);
fileRemove($strDelete);
}
}

Expand Down
12 changes: 9 additions & 3 deletions lib/BackRest/Common/Wait.pm
Expand Up @@ -22,12 +22,18 @@ use BackRest::Common::Log;
####################################################################################################################################
sub waitRemainder
{
my $bWait = shift;

my $lTimeBegin = gettimeofday();
my $lSleepMs = ceil(((int($lTimeBegin) + 1.05) - $lTimeBegin) * 1000);

usleep($lSleepMs * 1000);
if (!defined($bWait) || $bWait)
{
my $lSleepMs = ceil(((int($lTimeBegin) + 1.05) - $lTimeBegin) * 1000);

usleep($lSleepMs * 1000);

&log(TRACE, "WAIT_REMAINDER: slept ${lSleepMs}ms: begin ${lTimeBegin}, end " . gettimeofday());
&log(TRACE, "WAIT_REMAINDER: slept ${lSleepMs}ms: begin ${lTimeBegin}, end " . gettimeofday());
}

return int($lTimeBegin);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/BackRest/Expire.pm
Expand Up @@ -20,6 +20,7 @@ use BackRest::BackupCommon;
use BackRest::BackupInfo;
use BackRest::Config::Config;
use BackRest::File;
use BackRest::FileCommon;
use BackRest::Manifest;

####################################################################################################################################
Expand Down Expand Up @@ -401,8 +402,7 @@ sub process
# Remove archive log if it is not used in a backup
if ($bRemove)
{
unlink($oFile->pathGet(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"))
or confess &log(ERROR, 'unable to remove ' . $strSubPath, ERROR_FILE_REMOVE);
fileRemove($oFile->pathGet(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"));

logDebugMisc($strOperation, "remove WAL segment: ${strSubPath}");

Expand Down

0 comments on commit 885797e

Please sign in to comment.