fix(download_client): release rw lock (#183)

This commit is contained in:
Kyle Sanderson 2022-03-17 17:44:26 -07:00 committed by GitHub
parent fc1b234578
commit 18f323746a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ func (c *clientCache) Set(id int, client *domain.DownloadClient) {
func (c *clientCache) Get(id int) *domain.DownloadClient { func (c *clientCache) Get(id int) *domain.DownloadClient {
c.mu.RLock() c.mu.RLock()
defer c.mu.Unlock() defer c.mu.RUnlock()
v, ok := c.clients[id] v, ok := c.clients[id]
if ok { if ok {
return v return v