add timeout for AWS MetadataAccessor#318
add timeout for AWS MetadataAccessor#318mayurkale22 merged 2 commits intocensus-instrumentation:masterfrom
Conversation
248f495 to
1b40f56
Compare
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
- Coverage 94.93% 94.92% -0.01%
==========================================
Files 118 118
Lines 8101 8106 +5
Branches 723 723
==========================================
+ Hits 7691 7695 +4
- Misses 410 411 +1
Continue to review full report at Codecov.
|
| }); | ||
| req.on('error', (err) => reject(err)); | ||
| req.on('error', (err) => { | ||
| clearTimeout(timeoutId); |
There was a problem hiding this comment.
I'm assuming you don't need to clear the timeout on success as well since the promise would already be resolved, but just wanted to state that out loud in case it's wrong.
There was a problem hiding this comment.
I did clear out the timeout when we get response from endpoint. Line: https://github.com/census-instrumentation/opencensus-node/pull/318/files/1b40f56cd06cdbda2ed712b32e3eb1e7bffd0984#diff-e008cd5b71782eb32c1f53b01df244a4R131
There was a problem hiding this comment.
Thanks! Must have somehow missed that.
No description provided.