mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	Replace go-cache with golang-lru in dnssec (#336)
* Replace go-cache with golang-lru This fix replace go-cache with golang-lru, as is specified in 335. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Move cache initialization to setup This commit move cache initialization to setup in dnssec middleware. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
		| @@ -9,6 +9,7 @@ import ( | ||||
| 	"github.com/miekg/coredns/middleware/pkg/dnsrecorder" | ||||
| 	"github.com/miekg/coredns/middleware/test" | ||||
|  | ||||
| 	"github.com/hashicorp/golang-lru" | ||||
| 	"github.com/miekg/dns" | ||||
| 	"golang.org/x/net/context" | ||||
| ) | ||||
| @@ -77,7 +78,8 @@ func TestLookupZone(t *testing.T) { | ||||
| 	dnskey, rm1, rm2 := newKey(t) | ||||
| 	defer rm1() | ||||
| 	defer rm2() | ||||
| 	dh := New([]string{"miek.nl."}, []*DNSKEY{dnskey}, fm) | ||||
| 	cache, _ := lru.New(defaultCap) | ||||
| 	dh := New([]string{"miek.nl."}, []*DNSKEY{dnskey}, fm, cache) | ||||
| 	ctx := context.TODO() | ||||
|  | ||||
| 	for _, tc := range dnsTestCases { | ||||
| @@ -115,7 +117,8 @@ func TestLookupDNSKEY(t *testing.T) { | ||||
| 	dnskey, rm1, rm2 := newKey(t) | ||||
| 	defer rm1() | ||||
| 	defer rm2() | ||||
| 	dh := New([]string{"miek.nl."}, []*DNSKEY{dnskey}, test.ErrorHandler()) | ||||
| 	cache, _ := lru.New(defaultCap) | ||||
| 	dh := New([]string{"miek.nl."}, []*DNSKEY{dnskey}, test.ErrorHandler(), cache) | ||||
| 	ctx := context.TODO() | ||||
|  | ||||
| 	for _, tc := range dnssecTestCases { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user