-
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
fix: queue concurrent execution #551
Conversation
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #551 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 92 92
Lines 3384 3400 +16
Branches 569 571 +2
=========================================
+ Hits 3384 3400 +16
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
guardInterval: 1000 | ||
limiter: { | ||
max: 1, | ||
duration: 10000, |
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.
@chrisleekr Isn't 10 seconds too much?
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.
@uhliksk
Oh, is it acting weird?
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.
@chrisleekr
It is updating price once per 10 seconds which can skip price spikes easily. For example, if your sell trigger price here is 16897.00, you can skip an opportunity to sell silently just because you'll update before and after the spike.
Description
This PR is to address the issue with concurrency of the queue execution.
In addition, this PR includes some housekeeping tasks, which are better to be separated. Sorry.
The main changes are:
The housekeeping tasks are:
executeFor
is now passing the correlation ID to make it easy to trace - https://github.com/chrisleekr/binance-trading-bot/pull/551/files#diff-d2d27ec2077b90c3ff7d942d5cbfb3d98c992a7c1c6ffd6eac4f6e3321ea2180R68executeFor
.With the limiter setting, it should limit the job attempting to run while it's already running.
If the job is added while it's running, then it will be put in the waiting queue.
How to test
Related Issue
#541
Motivation and Context
See description
How Has This Been Tested?
It's running in https://binance-trading-bot-chrisleekr.cloud.okteto.net/
Screenshots (if appropriate):