@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[elasticsearch] Add timeout to API calls

Summary:
Default of 300 seconds is more than likely too much in most cases.
Provide the option to override.

Test Plan:
Blocked ElasticSearch with iptables
Set timeout to 5 seconds and make sure we error early

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2678

macvicar 1d94d49c 5c5351b5

+14
+14
src/applications/search/engine/PhabricatorSearchEngineElastic.php
··· 18 18 19 19 final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine { 20 20 private $uri; 21 + private $timeout; 21 22 22 23 public function __construct($uri) { 23 24 $this->uri = $uri; 25 + } 26 + 27 + public function setTimeout($timeout) { 28 + $this->timeout = $timeout; 29 + return $this; 30 + } 31 + 32 + public function getTimeout() { 33 + return $this->timeout; 24 34 } 25 35 26 36 public function reindexAbstractDocument( ··· 204 214 $future->setMethod('PUT'); 205 215 } else { 206 216 $future->setMethod('GET'); 217 + } 218 + 219 + if ($this->getTimeout()) { 220 + $future->setTimeout($this->getTimeout()); 207 221 } 208 222 209 223 list($body) = $future->resolvex();