mirror of
				https://github.com/binwiederhier/ntfy.git
				synced 2025-10-30 12:32:12 +01:00 
			
		
		
		
	Fix data races
This commit is contained in:
		
							parent
							
								
									c9f1b02251
								
							
						
					
					
						commit
						802ef17cb4
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		|  | @ -386,8 +386,11 @@ func (s *Server) handleSubscribe(w http.ResponseWriter, r *http.Request, v *visi | |||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var wlock sync.Mutex | ||||
| 	poll := r.URL.Query().Has("poll") | ||||
| 	sub := func(msg *message) error { | ||||
| 		wlock.Lock() | ||||
| 		defer wlock.Unlock() | ||||
| 		m, err := encoder(msg) | ||||
| 		if err != nil { | ||||
| 			return err | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Philipp Heckel
						Philipp Heckel