Merge pull request #55420 from nextcloud/fix/40082/appstore-timeout

pull/53113/merge
Kate 2025-09-30 17:18:37 +07:00 committed by GitHub
commit 86ef7781c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 6 deletions

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

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

@ -443,6 +443,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
@ -488,7 +494,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
'headers' => [
'If-None-Match' => '"myETag"'
]
@ -522,6 +528,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
@ -565,7 +577,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
'headers' => [
'If-None-Match' => '"myETag"',
]
@ -607,6 +619,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
@ -643,7 +661,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 60,
'timeout' => 120,
])
)
->willReturn($response);