Skip to content

Commit 1ddaeba

Browse files
committed
fix(appstore): Make appstore timeout configurable
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
1 parent 3a687ea commit 1ddaeba

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/private/App/AppStore/Fetcher/Fetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function fetch($ETag, $content, $allowUnstable = false) {
6767
}
6868

6969
$options = [
70-
'timeout' => 60,
70+
'timeout' => (int)$this->config->getAppValue('settings', 'appstore-timeout', '120')
7171
];
7272

7373
if ($ETag !== '') {

tests/lib/App/AppStore/Fetcher/FetcherBase.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ public function testGetMatchingETag(): void {
443443
$this->config->method('getSystemValueBool')
444444
->willReturnArgument(1);
445445

446+
$this->config->method('getAppValue')
447+
->willReturnMap([
448+
['settings', 'appstore-fetcher-lastFailure', '0', '0'],
449+
['settings', 'appstore-timeout', '120', '120'],
450+
]);
451+
446452
$folder = $this->createMock(ISimpleFolder::class);
447453
$file = $this->createMock(ISimpleFile::class);
448454
$this->appData
@@ -488,7 +494,7 @@ public function testGetMatchingETag(): void {
488494
->with(
489495
$this->equalTo($this->endpoint),
490496
$this->equalTo([
491-
'timeout' => 60,
497+
'timeout' => 120,
492498
'headers' => [
493499
'If-None-Match' => '"myETag"'
494500
]
@@ -565,7 +571,7 @@ public function testGetNoMatchingETag(): void {
565571
->with(
566572
$this->equalTo($this->endpoint),
567573
$this->equalTo([
568-
'timeout' => 60,
574+
'timeout' => 120,
569575
'headers' => [
570576
'If-None-Match' => '"myETag"',
571577
]
@@ -643,7 +649,7 @@ public function testFetchAfterUpgradeNoETag(): void {
643649
->with(
644650
$this->equalTo($this->endpoint),
645651
$this->equalTo([
646-
'timeout' => 60,
652+
'timeout' => 120,
647653
])
648654
)
649655
->willReturn($response);

0 commit comments

Comments
 (0)