forked from lug/matterbridge
Invalidate user in cache on user change event (#1604)
Co-authored-by: Wim <wim@42.be>
This commit is contained in:
committed by
GitHub
parent
b56f80b1b8
commit
b06a574cc5
@@ -113,6 +113,12 @@ func (b *users) populateUser(userID string) {
|
||||
b.users[userID] = user
|
||||
}
|
||||
|
||||
func (b *users) invalidateUser(userID string) {
|
||||
b.usersMutex.Lock()
|
||||
defer b.usersMutex.Unlock()
|
||||
delete(b.users, userID)
|
||||
}
|
||||
|
||||
func (b *users) populateUsers(wait bool) {
|
||||
b.refreshMutex.Lock()
|
||||
if !wait && (time.Now().Before(b.earliestRefresh) || b.refreshInProgress) {
|
||||
|
||||
Reference in New Issue
Block a user