-
-
Notifications
You must be signed in to change notification settings - Fork 343
REFACTOR: [session] Refactor max borrowable update #1993
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
Conversation
95c284d
to
ac10967
Compare
1f3ab94
to
b1cf070
Compare
03dce76
to
231484b
Compare
b8235c2
to
167b136
Compare
pkg/bbgo/session.go
Outdated
ctx context.Context, | ||
assets ...string, | ||
) { | ||
if session.Margin { |
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 should use if !session.Margin { warn }
as the function guard
pkg/bbgo/session.go
Outdated
) { | ||
t := time.NewTicker(timejitter.Milliseconds(interval, 500)) | ||
defer t.Stop() | ||
defer session.logger.Debug("max borrowable updating worker exit") |
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.
I mean, do we really need this log?
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, I will remove the log.
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.
I wrap the margin update logics into a new private struct, marginInfoUpdaterType
.
Conceptually, marginInfoUpdaterType
is private to exchange session.
APIs of marginInfoUpdaterType
are exposed via exchange session.
c019795
to
5b4f4cb
Compare
6dacd29
to
630c5aa
Compare
630c5aa
to
e88acd3
Compare
e88acd3
to
adacb6e
Compare
7876fa5
to
e8fc767
Compare
…ervice with callbacks
e8fc767
to
a328265
Compare
No description provided.