-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
perf: bulk write candles to db #481
perf: bulk write candles to db #481
Conversation
@habibalkhabbaz I'm getting this error:
Edit: Maybe it is not related to this PR, but I found it after I merged into my code. |
Hello @uhliksk Update: I think this issue is not related directly to this branch. |
@habibalkhabbaz Ok, I'll try. |
@habibalkhabbaz After restarting container I got:
It looks like it is not very healthy to restart container at any time. Maybe we should do some cleanup on container startup to prevent unpredictable states in database. |
@uhliksk |
It's amazing, man. I really appreciate your contributions. Is this ready to review? @habibalkhabbaz Ah, there is conflict. Let me know if you resolve it. 😄 |
@chrisleekr Conflict resolved and it's ready for review as well. |
As always, looks good to me. |
Description
I am so sorry about submitting a lot of PRs nowadays 😆 but believe me it's worth it.
This PR has performance improvement which uses
bulkWrite
instead of looping through all candles and insert them one by one.Related Issue
Motivation and Context
When we retrieve many candles from Binance, it will be a heavy job to save all candles one by one (many operations).
So I try to improve this with
bulkWrite
from mongo.How Has This Been Tested?
Tests provided
Screenshots (if appropriate):