diff options
author | Duco van Amstel <duco.vanamstel@gmail.com> | 2019-04-23 22:08:34 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2019-04-23 23:08:34 +0200 |
commit | 9be0be0316dccd47cd3686bad3d1d99955340af3 (patch) | |
tree | 65cf7cd64582a93ee838a826b2f663b5dc289012 /bridge | |
parent | 9f5f0047259f7b28e6e26b762cff853ecacec599 (diff) | |
download | matterbridge-msglm-9be0be0316dccd47cd3686bad3d1d99955340af3.tar.gz matterbridge-msglm-9be0be0316dccd47cd3686bad3d1d99955340af3.tar.bz2 matterbridge-msglm-9be0be0316dccd47cd3686bad3d1d99955340af3.zip |
Add lacking clean-up in Slack synchronisation (#811)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/slack/users_channels.go | 9 |
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) { |