-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
[Community] handle candles history fetch #2449
Conversation
c7428ad
to
c4c55a6
Compare
.eq( | ||
"exchange_internal_name", exchange | ||
).eq( | ||
"symbol", symbol | ||
).eq( | ||
"time_frame", time_frame.value |
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.
You can use match
instead of multiple eq
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.
up, thanks !
total_candles = [] | ||
max_requests_count = 100 | ||
request_count = 0 | ||
while request_count < max_requests_count: |
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.
Why do we need to do multiple requests?
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.
supabases has a max of rows returned by one query (1000 by default), here we want approx 18k rows for 15min over 6m
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.
And why not increasing supabase's limit?
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.
according to supabase this value should not be too high as it can take a lot of computing power from the db and be an attack vector. We can increase it though, this code will just adapt
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.
Ok thanks for the explanation 👍
90726e8
to
c82f1ee
Compare
total_candles = [] | ||
max_requests_count = 100 | ||
request_count = 0 | ||
while request_count < max_requests_count: |
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.
Should we catch if a request fails to not stop the whole loop or it's ok to raise?
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.
we would need a retry mechanism. I havn't seen it happen yet, do you think we should add it ?
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.
We can probably wait for it to happen a first time
requries Drakkar-Software/OctoBot-Trading#993