fix(appstore): Make appstore timeout configurable

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
pull/55439/head
Marcel Müller 2025-09-30 11:20:26 +07:00 committed by backportbot[bot]
parent 79dd3fe3be
commit f23bcc5580
3 changed files with 30 additions and 6 deletions

@ -66,7 +66,7 @@ abstract class Fetcher {
}
$options = [
'timeout' => 60,
'timeout' => (int)$this->config->getAppValue('settings', 'appstore-timeout', '120')
];
if ($ETag !== '') {

@ -2132,7 +2132,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->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',
],
@ -2190,6 +2190,12 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->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
@ -2217,7 +2223,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->expects($this->once())
->method('get')
->with('https://custom.appsstore.endpoint/api/v1/apps.json', [
'timeout' => 60,
'timeout' => 120,
])
->willReturn($response);
$response

@ -442,6 +442,12 @@ abstract class FetcherBase extends TestCase {
$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
@ -487,7 +493,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
'headers' => [
'If-None-Match' => '"myETag"'
]
@ -521,6 +527,12 @@ abstract class FetcherBase extends TestCase {
$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
@ -564,7 +576,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
'headers' => [
'If-None-Match' => '"myETag"',
]
@ -606,6 +618,12 @@ abstract class FetcherBase extends TestCase {
$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
@ -642,7 +660,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
])
)
->willReturn($response);