mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
Protect a read from a map with a mutex
This commit is contained in:
parent
bc18557820
commit
9ed359f964
@ -178,7 +178,9 @@ func (s *Server) handleFeedIcon(c *router.Context) {
|
||||
}
|
||||
|
||||
cachekey := "icon:" + strconv.FormatInt(id, 10)
|
||||
s.cache_mutex.Lock()
|
||||
cachedat := s.cache[cachekey]
|
||||
s.cache_mutex.Unlock()
|
||||
if cachedat == nil {
|
||||
feed := s.db.GetFeed(id)
|
||||
if feed == nil || feed.Icon == nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user