mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	@@ -110,7 +110,7 @@ func (c *Client) Run() {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if first {
 | 
							if first {
 | 
				
			||||||
			log.Info("gRPC stream established to %q", c.to)
 | 
								log.Infof("gRPC stream established to %q", c.to)
 | 
				
			||||||
			c.setSynced()
 | 
								c.setSynced()
 | 
				
			||||||
			first = false
 | 
								first = false
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,13 +1,13 @@
 | 
				
			|||||||
package xds
 | 
					package xds
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Assignment returns the current assignment map.
 | 
					// Assignments returns the current assignment map.
 | 
				
			||||||
func (c *Client) Assignments() *assignment {
 | 
					func (c *Client) Assignments() *assignment {
 | 
				
			||||||
	c.mu.RLock()
 | 
						c.mu.RLock()
 | 
				
			||||||
	defer c.mu.RUnlock()
 | 
						defer c.mu.RUnlock()
 | 
				
			||||||
	return c.assignments
 | 
						return c.assignments
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SetAssignment sets the assignment map.
 | 
					// SetAssignments sets the assignment map.
 | 
				
			||||||
func (c *Client) SetAssignments(a *assignment) {
 | 
					func (c *Client) SetAssignments(a *assignment) {
 | 
				
			||||||
	c.mu.Lock()
 | 
						c.mu.Lock()
 | 
				
			||||||
	defer c.mu.Unlock()
 | 
						defer c.mu.Unlock()
 | 
				
			||||||
@@ -42,14 +42,14 @@ func (c *Client) SetNonce(typeURL, n string) {
 | 
				
			|||||||
	c.nonce[typeURL] = n
 | 
						c.nonce[typeURL] = n
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SetSynced sets the synced boolean to true.
 | 
					// setSynced sets the synced boolean to true.
 | 
				
			||||||
func (c *Client) setSynced() {
 | 
					func (c *Client) setSynced() {
 | 
				
			||||||
	c.mu.Lock()
 | 
						c.mu.Lock()
 | 
				
			||||||
	defer c.mu.Unlock()
 | 
						defer c.mu.Unlock()
 | 
				
			||||||
	c.synced = true
 | 
						c.synced = true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Synced return true if the clients has synced.
 | 
					// HasSynced return true if the clients has synced.
 | 
				
			||||||
func (c *Client) HasSynced() bool {
 | 
					func (c *Client) HasSynced() bool {
 | 
				
			||||||
	c.mu.RLock()
 | 
						c.mu.RLock()
 | 
				
			||||||
	defer c.mu.RUnlock()
 | 
						defer c.mu.RUnlock()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user