summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-02-12 13:31:11 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-02-12 16:52:45 +0100
commitd06ef07a97a9ca8826d9c47c925f633c145683a7 (patch)
tree98c2beb6ae57824468de59b5b83849941de4a9b4 /lib
parente2e42d4ffd2b07c32fde1a36c64e48de334cac56 (diff)
downloadnextcloud-server-d06ef07a97a9ca8826d9c47c925f633c145683a7.tar.gz
nextcloud-server-d06ef07a97a9ca8826d9c47c925f633c145683a7.zip
disable timeout on app install via cli
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Installer.php19
-rw-r--r--lib/private/Server.php3
2 files changed, 15 insertions, 7 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 790bec0ddd5..b3919f22d03 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -70,6 +70,8 @@ class Installer {
private $apps = null;
/** @var bool|null - for caching the result of the ready status */
private $isInstanceReadyForUpdates = null;
+ /** @var bool */
+ private $isCLI;
/**
* @param AppFetcher $appFetcher
@@ -78,16 +80,20 @@ class Installer {
* @param ILogger $logger
* @param IConfig $config
*/
- public function __construct(AppFetcher $appFetcher,
- IClientService $clientService,
- ITempManager $tempManager,
- ILogger $logger,
- IConfig $config) {
+ public function __construct(
+ AppFetcher $appFetcher,
+ IClientService $clientService,
+ ITempManager $tempManager,
+ ILogger $logger,
+ IConfig $config,
+ bool $isCLI
+ ) {
$this->appFetcher = $appFetcher;
$this->clientService = $clientService;
$this->tempManager = $tempManager;
$this->logger = $logger;
$this->config = $config;
+ $this->isCLI = $isCLI;
}
/**
@@ -270,8 +276,9 @@ class Installer {
// Download the release
$tempFile = $this->tempManager->getTemporaryFile('.tar.gz');
+ $timeout = $this->isCLI ? 0 : 120;
$client = $this->clientService->newClient();
- $client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => 120]);
+ $client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => $timeout]);
// Check if the signature actually matches the downloaded content
$certificate = openssl_get_publickey($app['certificate']);
diff --git a/lib/private/Server.php b/lib/private/Server.php
index caaacab0a0a..d6c8e57d696 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -1272,7 +1272,8 @@ class Server extends ServerContainer implements IServerContainer {
$c->getHTTPClientService(),
$c->getTempManager(),
$c->getLogger(),
- $c->getConfig()
+ $c->getConfig(),
+ \OC::$CLI
);
});