-
Notifications
You must be signed in to change notification settings - Fork 263
feat/add ttlMap + binanceExchangeWs + binanceExchangeWs.GetTickerPrice #717
feat/add ttlMap + binanceExchangeWs + binanceExchangeWs.GetTickerPrice #717
Conversation
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.
Added some comments inline. Should be good to merge after that and will set a good pattern for the rest of the PRs. First one is the hardest so thank you for getting through it!
|
||
if stream, isStream := beWs.streams[stream]; isStream { | ||
stream.Close() | ||
} |
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.
do we also need to remove all values from beWs.streams
?
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 remove them, but it's only if we want this
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.
yes lets' remove please
|
||
if stream, isStream := beWs.streams[stream]; isStream { | ||
stream.Close() | ||
} |
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.
yes lets' remove please
plugins/binanceExchange_ws.go
Outdated
//Del ... delete cached value | ||
func (m *mapEvents) Del(key string) { | ||
m.mtx.Lock() | ||
m.mtx.Unlock() |
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.
forgot the defer
keyword in defer m.mtx.Unlock()
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.
LGTM, thanks!
Guidelines for submitting code to Kelp
Before Submitting a PR
Problem Identification
Research Solution
Technical Design Discussion
Implementation
Pull Request
Handling of PRs
Typically, this is what is expected from the author of a Pull Request:
Draft PRs