Skip to content

Commit 4923002

Browse files
authored
Merge pull request #15 from keboola/erik-PS-3880
set client timeouts
2 parents 06b746f + 722cfbf commit 4923002

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pool:
1111
variables:
1212
DOCKER_BUILDKIT: 1
1313
k8sNamespace: 'dev-notification-client'
14-
ciClusterServiceConnection: 'CI AKS'
14+
ciClusterServiceConnectionAKS: 'CI AKS 2022'
1515

1616
stages:
1717
- stage: prepare
@@ -26,7 +26,7 @@ stages:
2626
displayName: kubectl login
2727
inputs:
2828
connectionType: 'Kubernetes Service Connection'
29-
kubernetesServiceEndpoint: $(ciClusterServiceConnection)
29+
kubernetesServiceEndpoint: $(ciClusterServiceConnectionAKS)
3030
command: login
3131
- script: |
3232
set -Eeuo pipefail
@@ -93,7 +93,7 @@ stages:
9393
displayName: kubectl login
9494
inputs:
9595
connectionType: 'Kubernetes Service Connection'
96-
kubernetesServiceEndpoint: $(ciClusterServiceConnection)
96+
kubernetesServiceEndpoint: $(ciClusterServiceConnectionAKS)
9797
command: login
9898

9999
- script: |

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
},
6161
"config": {
6262
"sort-packages": true,
63-
"process-timeout": 3600
63+
"process-timeout": 3600,
64+
"allow-plugins": {
65+
"infection/extension-installer": true
66+
}
6467
}
6568
}

src/Client.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use GuzzleHttp\MessageFormatter;
1313
use GuzzleHttp\Middleware;
1414
use GuzzleHttp\Psr7\Request;
15+
use GuzzleHttp\RequestOptions;
1516
use JsonException;
1617
use Keboola\NotificationClient\Exception\ClientException as NotificationClientException;
1718
use Psr\Http\Message\RequestInterface;
@@ -106,7 +107,12 @@ function (RequestInterface $request) use ($token, $options) {
106107
));
107108
}
108109
// finally create the instance
109-
return new GuzzleClient(['base_uri' => $url, 'handler' => $handlerStack]);
110+
return new GuzzleClient([
111+
'base_uri' => $url,
112+
'handler' => $handlerStack,
113+
RequestOptions::CONNECT_TIMEOUT => 10,
114+
RequestOptions::TIMEOUT => 120,
115+
]);
110116
}
111117

112118
protected function sendRequest(Request $request): array

0 commit comments

Comments
 (0)