summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2019-04-23 22:08:34 +0100
committerWim <wim@42.be>2019-04-23 23:28:35 +0200
commitaefa8a93415c895ca5cbbdf4a6de696a8edde405 (patch)
tree9042441fa51eee75ed12ed7fa00caee85e2fd27c
parent1c3e764d572fdb0bc2a371028126a66b376e390e (diff)
downloadmatterbridge-msglm-aefa8a93415c895ca5cbbdf4a6de696a8edde405.tar.gz
matterbridge-msglm-aefa8a93415c895ca5cbbdf4a6de696a8edde405.tar.bz2
matterbridge-msglm-aefa8a93415c895ca5cbbdf4a6de696a8edde405.zip
Add lacking clean-up in Slack synchronisation (#811)
-rw-r--r--bridge/slack/users_channels.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/bridge/slack/users_channels.go b/bridge/slack/users_channels.go
index 23807c8d..ce14e509 100644
--- a/bridge/slack/users_channels.go
+++ b/bridge/slack/users_channels.go
@@ -87,6 +87,11 @@ func (b *users) populateUser(userID string) {
// in case the previous query failed for some reason.
} else {
b.usersSyncPoints[userID] = make(chan struct{})
+ defer func() {
+ // Wake up any waiting goroutines and remove the synchronization point.
+ close(b.usersSyncPoints[userID])
+ delete(b.usersSyncPoints, userID)
+ }()
break
}
}
@@ -106,10 +111,6 @@ func (b *users) populateUser(userID string) {
// Register user information.
b.users[userID] = user
-
- // Wake up any waiting goroutines and remove the synchronization point.
- close(b.usersSyncPoints[userID])
- delete(b.usersSyncPoints, userID)
}
func (b *users) populateUsers(wait bool) {