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