Closed neverfox closed 9 years ago
@neverfox Great proposal. Does this commit 7c3551aaba2ba84318ae137bf8dd3f55be7cbc11 (yahoo-finance@0.2.9
) help with the problem you encountered?
@pilwon I'll check it out tonight. Thanks for the fast work.
I can confirm that it works as expected in that context now.
@neverfox :+1:
Making the jump from 0.1.x to 0.2.x, I did have to refactor to adjust for the fact that a single symbol historical request no longer returns the symbol and url along with the quotes. What was the thought behind that change?
And thank you!
@neverfox To keep it more simple and straightforward. the symbol(s) information is already known to the caller, therefore it is redundant to return this information back to the caller. The new version of this library also became a bit smarter with fetching and transforming data, therefore url is no longer needed to be exposed. If you still want to see the url, you can always run your app with DEBUG=yahoo-finance:*
env var.
I attempted to pair this library with retry to deal with those inevitable moments when Yahoo! responds with an error, like so:
What I discovered in my logs was something like this:
All of my retries were trying to use timestamps rather than date strings, and failing as a result. After scouring my code, I took a peek at the source for node-yahoo-finance and realized that it was directly manipulating the options object that was originally passed in:
So I would like to propose a change that would not modify the options object, because I think being able to pair node-yahoo-finance with something like retry is powerful and useful. Plus I think it makes good sense to be able to trust that an object that you create isn't being modified outside of your vision. I would be willing to do a PR but if you have any guidance on how you would like to handle it, please let me know.