Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13959819
D20529.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20529.diff
View Options
diff --git a/src/future/asana/PhutilAsanaFuture.php b/src/future/asana/PhutilAsanaFuture.php
--- a/src/future/asana/PhutilAsanaFuture.php
+++ b/src/future/asana/PhutilAsanaFuture.php
@@ -7,6 +7,7 @@
private $action;
private $params;
private $method = 'GET';
+ private $timeout;
public function __construct() {
parent::__construct(null);
@@ -28,6 +29,15 @@
return $this;
}
+ public function setTimeout($timeout) {
+ $this->timeout = $timeout;
+ return $this;
+ }
+
+ public function getTimeout() {
+ return $this->timeout;
+ }
+
protected function getProxiedFuture() {
if (!$this->future) {
$params = $this->params;
@@ -54,6 +64,11 @@
$future->addHeader('Authorization', 'Bearer '.$this->accessToken);
$future->setMethod($this->method);
+ $timeout = $this->getTimeout();
+ if ($timeout !== null) {
+ $future->setTimeout($timeout);
+ }
+
$this->future = $future;
}
diff --git a/src/future/oauth/PhutilOAuth1Future.php b/src/future/oauth/PhutilOAuth1Future.php
--- a/src/future/oauth/PhutilOAuth1Future.php
+++ b/src/future/oauth/PhutilOAuth1Future.php
@@ -23,6 +23,7 @@
private $hasConstructedFuture;
private $callbackURI;
private $headers = array();
+ private $timeout;
public function setCallbackURI($callback_uri) {
$this->callbackURI = $callback_uri;
@@ -74,6 +75,15 @@
return $this;
}
+ public function setTimeout($timeout) {
+ $this->timeout = $timeout;
+ return $this;
+ }
+
+ public function getTimeout() {
+ return $this->timeout;
+ }
+
public function __construct($uri, $data = array()) {
$this->uri = new PhutilURI((string)$uri);
$this->data = $data;
@@ -135,6 +145,11 @@
}
$this->headers = array();
+ $timeout = $this->getTimeout();
+ if ($timeout !== null) {
+ $future->setTimeout($timeout);
+ }
+
$this->hasConstructedFuture = true;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 15, 8:51 PM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714032
Default Alt Text
D20529.diff (1 KB)
Attached To
Mode
D20529: Support timeouts in OAuth1Future
Attached
Detach File
Event Timeline
Log In to Comment