Skip to content

Commit 0a66b43

Browse files
committed
disable timeout on app install via cli
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent e2e42d4 commit 0a66b43

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

lib/private/Installer.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class Installer {
7070
private $apps = null;
7171
/** @var bool|null - for caching the result of the ready status */
7272
private $isInstanceReadyForUpdates = null;
73+
/** @var bool */
74+
private $isCLI;
7375

7476
/**
7577
* @param AppFetcher $appFetcher
@@ -78,16 +80,20 @@ class Installer {
7880
* @param ILogger $logger
7981
* @param IConfig $config
8082
*/
81-
public function __construct(AppFetcher $appFetcher,
82-
IClientService $clientService,
83-
ITempManager $tempManager,
84-
ILogger $logger,
85-
IConfig $config) {
83+
public function __construct(
84+
AppFetcher $appFetcher,
85+
IClientService $clientService,
86+
ITempManager $tempManager,
87+
ILogger $logger,
88+
IConfig $config,
89+
bool $isCLI
90+
) {
8691
$this->appFetcher = $appFetcher;
8792
$this->clientService = $clientService;
8893
$this->tempManager = $tempManager;
8994
$this->logger = $logger;
9095
$this->config = $config;
96+
$this->isCLI = $isCLI;
9197
}
9298

9399
/**
@@ -270,8 +276,9 @@ public function downloadApp($appId) {
270276

271277
// Download the release
272278
$tempFile = $this->tempManager->getTemporaryFile('.tar.gz');
279+
$timeout = $this->isCLI ? 0 : 120;
273280
$client = $this->clientService->newClient();
274-
$client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => 120]);
281+
$client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => $timeout]);
275282

276283
// Check if the signature actually matches the downloaded content
277284
$certificate = openssl_get_publickey($app['certificate']);

lib/private/Server.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,8 @@ public function __construct($webRoot, \OC\Config $config) {
12721272
$c->getHTTPClientService(),
12731273
$c->getTempManager(),
12741274
$c->getLogger(),
1275-
$c->getConfig()
1275+
$c->getConfig(),
1276+
\OC::$CLI
12761277
);
12771278
});
12781279

0 commit comments

Comments
 (0)