-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timeouts #63
timeouts #63
Conversation
7c96ab1
to
84519f3
Compare
@@ -2,5 +2,6 @@ export default { | |||
baseUrl: 'https://api.particle.io', | |||
clientSecret: 'particle-api', | |||
clientId: 'particle-api', | |||
tokenDuration: 7776000 // 90 days | |||
tokenDuration: 7776000, // 90 days | |||
timeout: 60000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this value going to be used anywhere? It sets particle.timeout = 60000
but this.timeout
is not used in the Particle
class. If it's unused let's remove this line.
@@ -137,6 +145,9 @@ export default class Agent { | |||
if (query) { | |||
req.query(query); | |||
} | |||
if (timeout!==undefined) { | |||
req.timeout(timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the user-facing behavior of a timeout? This is an public interface change. An opt-in one but a change nevertheless. How would a user program deal with a timeout vs an HTTP error?
@@ -137,6 +145,9 @@ export default class Agent { | |||
if (query) { | |||
req.query(query); | |||
} | |||
if (timeout!==undefined) { | |||
req.timeout(timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the user-facing behavior of a timeout? Adding a timeout is a public interface change since it will affect the promise rejection. We need to document what will happen when there's a timeout compared to an HTTP error. This is more of a documentation comment.
adds timeouts based on #20, with unit tests
[CH4422]