Merge pull request #4825 from nextcloud/add-timeout-appstore

Add timeout for requests to appstore
This commit is contained in:
Lukas Reschke 2017-05-12 12:37:18 +02:00 committed by GitHub
commit 48a9a4bd81
2 changed files with 8 additions and 2 deletions

View File

@ -85,7 +85,9 @@ abstract class Fetcher {
return [];
}
$options = [];
$options = [
'timeout' => 10,
];
if ($ETag !== '') {
$options['headers'] = [

View File

@ -514,6 +514,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'If-None-Match' => '"myETag"'
]
@ -585,6 +586,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
'timeout' => 10,
'headers' => [
'If-None-Match' => '"myETag"',
]
@ -670,7 +672,9 @@ abstract class FetcherBase extends TestCase {
->method('get')
->with(
$this->equalTo($this->endpoint),
$this->equalTo([])
$this->equalTo([
'timeout' => 10,
])
)
->willReturn($response);
$response->method('getStatusCode')