Use RUnlock method without defer

This commit is contained in:
Peter Stuifzand 2018-10-03 18:43:57 +02:00
parent 7c18c4811f
commit 036152d89e
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -119,13 +119,12 @@ func (b *memoryBackend) refreshChannels() {
conn.Do("SETNX", "channel_sortorder_notifications", 1)
b.lock.RLock()
defer b.lock.RUnlock()
for uid, channel := range b.Channels {
log.Printf("loading channel %s - %s\n", uid, channel.Name)
conn.Do("SADD", "channels", uid)
conn.Do("SETNX", "channel_sortorder_"+uid, 99999)
}
b.lock.RUnlock()
}
func (b *memoryBackend) save() {