PHRAS-3413 add timeout when emit webhook

This commit is contained in:
aynsix
2021-11-08 16:51:11 +03:00
parent 5b93a4b735
commit a186068b07
3 changed files with 5 additions and 1 deletions

View File

@@ -343,6 +343,8 @@ workers:
pullAssets: pullAssets:
ttl_retry: 5000 ttl_retry: 5000
max_retry : 5 max_retry : 5
webhook:
timeout: 30
externalservice: externalservice:
ginger: ginger:

View File

@@ -89,6 +89,7 @@ class WebhookWorker implements WorkerInterface
$proxyConfig = new NetworkProxiesConfiguration($this->app['conf']); $proxyConfig = new NetworkProxiesConfiguration($this->app['conf']);
$clientOptions = [ $clientOptions = [
'timeout' => $this->app['conf']->get(['workers', 'webhook', 'timeout'], 30), // default time out 30 sec if not set
'connect_timeout' => 50, // should be less than default rabbit timeout 60 to avoid to block Q 'connect_timeout' => 50, // should be less than default rabbit timeout 60 to avoid to block Q
'headers' => [ 'headers' => [
'User-Agent' => sprintf('Phraseanet/%s (%s)', $version->getNumber(), $version->getName()) 'User-Agent' => sprintf('Phraseanet/%s (%s)', $version->getNumber(), $version->getName())

View File

@@ -335,7 +335,8 @@ workers:
password: '' password: ''
vhost: / vhost: /
heartbeat: 60 heartbeat: 60
webhook:
timeout: 30
externalservice: externalservice:
ginger: ginger:
AutoSubtitling: AutoSubtitling: