mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13:14 -04:00 
			
		
		
		
	forward: respect context (#6483)
Signed-off-by: Vladislav Yarmak <vladislav-ex-src@vm-0.com>
This commit is contained in:
		| @@ -110,7 +110,7 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg | ||||
| 	list := f.List() | ||||
| 	deadline := time.Now().Add(defaultTimeout) | ||||
| 	start := time.Now() | ||||
| 	for time.Now().Before(deadline) { | ||||
| 	for time.Now().Before(deadline) && ctx.Err() == nil { | ||||
| 		if i >= len(list) { | ||||
| 			// reached the end of list, reset to begin | ||||
| 			i = 0 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user