mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
livenote: cache object id
This commit is contained in:
parent
0471cb2340
commit
0e2eb8ba54
|
@ -14,6 +14,8 @@ type LiveNote struct {
|
|||
ChannelID string `json:"channelId"`
|
||||
|
||||
Object Object
|
||||
|
||||
cachedObjID string
|
||||
}
|
||||
|
||||
func NewLiveNote(object Object) *LiveNote {
|
||||
|
@ -23,7 +25,12 @@ func NewLiveNote(object Object) *LiveNote {
|
|||
}
|
||||
|
||||
func (n *LiveNote) ObjectID() string {
|
||||
return n.Object.ObjectID()
|
||||
if n.cachedObjID != "" {
|
||||
return n.cachedObjID
|
||||
}
|
||||
|
||||
n.cachedObjID = n.Object.ObjectID()
|
||||
return n.cachedObjID
|
||||
}
|
||||
|
||||
func (n *LiveNote) SetMessageID(messageID string) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user