Changeset View
Changeset View
Standalone View
Standalone View
src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (!$accounts) { | ||||
| return $this->didFailOnMissingLink(); | return $this->didFailOnMissingLink(); | ||||
| } | } | ||||
| // TODO: When we support multiple JIRA instances, we need to disambiguate | // TODO: When we support multiple JIRA instances, we need to disambiguate | ||||
| // issues (perhaps with additional configuration) or cast a wide net | // issues (perhaps with additional configuration) or cast a wide net | ||||
| // (by querying all instances). For now, just query the one instance. | // (by querying all instances). For now, just query the one instance. | ||||
| $account = head($accounts); | $account = head($accounts); | ||||
| $timeout = $this->getTimeout(); | |||||
| $futures = array(); | $futures = array(); | ||||
| foreach ($id_map as $key => $id) { | foreach ($id_map as $key => $id) { | ||||
| $futures[$key] = $provider->newJIRAFuture( | $future = $provider->newJIRAFuture( | ||||
| $account, | $account, | ||||
| 'rest/api/2/issue/'.phutil_escape_uri($id), | 'rest/api/2/issue/'.phutil_escape_uri($id), | ||||
| 'GET'); | 'GET'); | ||||
| if ($timeout !== null) { | |||||
| $future->setTimeout($timeout); | |||||
| } | |||||
| $futures[$key] = $future; | |||||
| } | } | ||||
| $results = array(); | $results = array(); | ||||
| $failed = array(); | $failed = array(); | ||||
| foreach (new FutureIterator($futures) as $key => $future) { | foreach (new FutureIterator($futures) as $key => $future) { | ||||
| try { | try { | ||||
| $results[$key] = $future->resolveJSON(); | $results[$key] = $future->resolveJSON(); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||