n0mad01 / node.bittrex.api

No longer maintained
MIT License
183 stars 187 forks source link

Fixed concurrent request by copying object values #51

Closed mhuggins closed 7 years ago

mhuggins commented 7 years ago

@n0mad01 I believe this will fix #49 by copying a default object rather than reusing the same object across function calls. I'm going to test locally, and I'll update you. Please let me know if you see any concerns with the approach in the meantime.

mhuggins commented 7 years ago

I tested this locally on my own app, and this fixes the issue I pointed out in #49. My output now looks as expected:

requested from https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-AUR&tickInterval=oneMin in: 1.01s requested from https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-FAIR&tickInterval=oneMin in: 1.265s requested from https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-EFL&tickInterval=oneMin in: 1.484s requested from https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-GLD&tickInterval=oneMin in: 1.489s requested from https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-EXCL&tickInterval=oneMin in: 1.478s etc...

n0mad01 commented 7 years ago

thanks a lot!