Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/App/AppStore/Fetcher/Fetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function fetch($ETag, $content) {
}

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

if ($ETag !== '') {
Expand Down
10 changes: 8 additions & 2 deletions tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,7 @@ public function testGetAppsAllowlist(): void {
->expects($this->once())
->method('get')
->with('https://apps.nextcloud.com/api/v1/apps.json', [
'timeout' => 60,
'timeout' => 120,
'headers' => [
'X-NC-Subscription-Key' => 'subscription-key',
],
Expand Down Expand Up @@ -2190,6 +2190,12 @@ public function testGetAppsAllowlistCustomAppstore(): void {
->method('getSystemValueBool')
->willReturnArgument(1);

$this->config->method('getAppValue')
->willReturnMap([
['settings', 'appstore-fetcher-lastFailure', '0', '0'],
['settings', 'appstore-timeout', '120', '120'],
]);

$file = $this->createMock(ISimpleFile::class);
$folder = $this->createMock(ISimpleFolder::class);
$folder
Expand Down Expand Up @@ -2217,7 +2223,7 @@ public function testGetAppsAllowlistCustomAppstore(): void {
->expects($this->once())
->method('get')
->with('https://custom.appsstore.endpoint/api/v1/apps.json', [
'timeout' => 60,
'timeout' => 120,
])
->willReturn($response);
$response
Expand Down
24 changes: 21 additions & 3 deletions tests/lib/App/AppStore/Fetcher/FetcherBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@ public function testGetMatchingETag(): void {
$this->config->method('getSystemValueBool')
->willReturnArgument(1);

$this->config->method('getAppValue')
->willReturnMap([
['settings', 'appstore-fetcher-lastFailure', '0', '0'],
['settings', 'appstore-timeout', '120', '120'],
]);

$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$this->appData
Expand Down Expand Up @@ -487,7 +493,7 @@ public function testGetMatchingETag(): void {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
'headers' => [
'If-None-Match' => '"myETag"'
]
Expand Down Expand Up @@ -521,6 +527,12 @@ public function testGetNoMatchingETag(): void {
$this->config->method('getSystemValueBool')
->willReturnArgument(1);

$this->config->method('getAppValue')
->willReturnMap([
['settings', 'appstore-fetcher-lastFailure', '0', '0'],
['settings', 'appstore-timeout', '120', '120'],
]);

$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$this->appData
Expand Down Expand Up @@ -564,7 +576,7 @@ public function testGetNoMatchingETag(): void {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
'headers' => [
'If-None-Match' => '"myETag"',
]
Expand Down Expand Up @@ -606,6 +618,12 @@ public function testFetchAfterUpgradeNoETag(): void {
$this->config->method('getSystemValueBool')
->willReturnArgument(1);

$this->config->method('getAppValue')
->willReturnMap([
['settings', 'appstore-fetcher-lastFailure', '0', '0'],
['settings', 'appstore-timeout', '120', '120'],
]);

$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$this->appData
Expand Down Expand Up @@ -642,7 +660,7 @@ public function testFetchAfterUpgradeNoETag(): void {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
])
)
->willReturn($response);
Expand Down
Loading