fix(usernames): sync index active collectible aliases
This commit is contained in:
parent
2f995f607a
commit
5156b17c1b
29 changed files with 657 additions and 112 deletions
|
|
@ -101,7 +101,8 @@ type ChannelStore struct {
|
|||
// topicReads 是 per-(channel,user,topic) 已读水位(forum 话题独立已读,不碰频道级 member 水位)。
|
||||
topicReads map[int64]map[int64]map[int]memoryTopicRead
|
||||
// polls 是共享 poll 权威(与 MessageStore 同一实例);nil 时 poll 链路按未接入处理。
|
||||
polls *PollStore
|
||||
polls *PollStore
|
||||
usernameRegistry *CollectibleUsernameStore
|
||||
}
|
||||
|
||||
// AttachPollStore 注入共享 poll 权威。
|
||||
|
|
@ -109,6 +110,14 @@ func (s *ChannelStore) AttachPollStore(polls *PollStore) {
|
|||
s.polls = polls
|
||||
}
|
||||
|
||||
// AttachUsernameRegistry gives the memory backend the same global username
|
||||
// index the PostgreSQL stores share through peer_usernames.
|
||||
func (s *ChannelStore) AttachUsernameRegistry(registry *CollectibleUsernameStore) {
|
||||
s.mu.Lock()
|
||||
s.usernameRegistry = registry
|
||||
s.mu.Unlock()
|
||||
}
|
||||
|
||||
// NewChannelStore creates an in-memory ChannelStore.
|
||||
func NewChannelStore() *ChannelStore {
|
||||
return &ChannelStore{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue