cache: add negative cache; router: skip race for cached 404s
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibeb44b313850395898bb20f2d947b0b76a6a6964
This commit is contained in:
parent
f100342720
commit
b0ea022dc2
7 changed files with 147 additions and 4 deletions
|
|
@ -132,7 +132,7 @@ func TestValidateBadAlpha(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestValidateNegativeTTL(t *testing.T) {
|
||||
func TestValidateZeroTTL(t *testing.T) {
|
||||
cfg, _ := config.Load("")
|
||||
cfg.Cache.TTL = config.Duration{}
|
||||
if err := cfg.Validate(); err == nil {
|
||||
|
|
@ -140,6 +140,14 @@ func TestValidateNegativeTTL(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestValidateNegativeTTL(t *testing.T) {
|
||||
cfg, _ := config.Load("")
|
||||
cfg.Cache.NegativeTTL = config.Duration{}
|
||||
if err := cfg.Validate(); err == nil {
|
||||
t.Error("expected error for zero negative_ttl")
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateMeshEnabledNoPeers(t *testing.T) {
|
||||
cfg, _ := config.Load("")
|
||||
cfg.Mesh.Enabled = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue