summaryrefslogtreecommitdiffstats
path: root/bridge/slack/users_channels.go
diff options
context:
space:
mode:
authorJonathan Walker (Keenan) <xorith@gmail.com>2021-10-16 17:36:30 -0400
committerGitHub <noreply@github.com>2021-10-16 23:36:30 +0200
commitb06a574cc51feb7195c312ceabb5634275e66d97 (patch)
tree9f93fb0f1d9cf5848353c6a2718d9b488c4286ed /bridge/slack/users_channels.go
parentb56f80b1b82d58c40919598662ef6184d617976c (diff)
downloadmatterbridge-msglm-b06a574cc51feb7195c312ceabb5634275e66d97.tar.gz
matterbridge-msglm-b06a574cc51feb7195c312ceabb5634275e66d97.tar.bz2
matterbridge-msglm-b06a574cc51feb7195c312ceabb5634275e66d97.zip
Invalidate user in cache on user change event (#1604)
Co-authored-by: Wim <wim@42.be>
Diffstat (limited to 'bridge/slack/users_channels.go')
-rw-r--r--bridge/slack/users_channels.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/slack/users_channels.go b/bridge/slack/users_channels.go
index 41fd0bd8..9b34b779 100644
--- a/bridge/slack/users_channels.go
+++ b/bridge/slack/users_channels.go
@@ -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) {