mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
fix(appstore): Make appstore timeout configurable
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
parent
3a687eac54
commit
31481701f3
3 changed files with 30 additions and 6 deletions
|
|
@ -67,7 +67,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue