From 8baa1a01fd7b0ebfd300a4e1042fe2a59295e381 Mon Sep 17 00:00:00 2001 From: Julien Galletta Date: Thu, 7 Dec 2017 13:33:46 +0100 Subject: [PATCH] Make configurable tar timeout also impact the scp command from Tar/CopyTask. --- src/Task/BuiltIn/Deploy/Tar/CopyTask.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Task/BuiltIn/Deploy/Tar/CopyTask.php b/src/Task/BuiltIn/Deploy/Tar/CopyTask.php index 314ae26..3bb5f77 100644 --- a/src/Task/BuiltIn/Deploy/Tar/CopyTask.php +++ b/src/Task/BuiltIn/Deploy/Tar/CopyTask.php @@ -45,7 +45,7 @@ class CopyTask extends AbstractTask $tarPath = $this->runtime->getEnvOption('tar_extract_path', 'tar'); $flags = $this->runtime->getEnvOption('tar_extract', 'xfzop'); - $timeout = $this->runtime->getEnvOption('tar_timeout', 600); + $timeout = $this->runtime->getEnvOption('tar_timeout', 300); $targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId); $tarLocal = $this->runtime->getVar('tar_local'); @@ -54,10 +54,10 @@ class CopyTask extends AbstractTask $cmdCopy = sprintf('scp -P %d %s %s %s@%s:%s/%s', $sshConfig['port'], $sshConfig['flags'], $tarLocal, $user, $host, $targetDir, $tarRemote); /** @var Process $process */ - $process = $this->runtime->runLocalCommand($cmdCopy, 300); + $process = $this->runtime->runLocalCommand($cmdCopy, $timeout); if ($process->isSuccessful()) { $cmdUnTar = sprintf('cd %s && %s %s %s', $targetDir, $tarPath, $flags, $tarRemote); - $process = $this->runtime->runRemoteCommand($cmdUnTar, false, $timeout); + $process = $this->runtime->runRemoteCommand($cmdUnTar, false, $timeout + 300); if ($process->isSuccessful()) { $cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote); $process = $this->runtime->runRemoteCommand($cmdDelete, false);