Skip to content

Commit

Permalink
Format code; Fix default config
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn1m committed Jan 9, 2021
1 parent 25ceeb8 commit 3b0f93b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hostsFile:
minimumTTL: 0
domainTTLFile: ./domain_ttl_sample
cacheSize: 0
cacheRedisUrl: redis://localhost:6379/0
cacheRedisConnectionPoolSize: 10
cacheRedisUrl:
cacheRedisConnectionPoolSize:
rejectQType:
- 255
8 changes: 4 additions & 4 deletions core/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ func (c *Cache) InsertMessage(s string, m *dns.Msg, mTTL uint32) {
} else {
err = c.InsertMessageToRedis(s, m, mTTL)
}
if err!=nil{
log.Warnf("Insert cache failed: %s", s, err)
}else {
if err != nil {
log.Warn("Insert cache failed", s, err)
} else {
log.Debugf("Cached: %s", s)
}
}

func (c *Cache) InsertMessageToRedis(s string, m *dns.Msg, mTTL uint32) error{
func (c *Cache) InsertMessageToRedis(s string, m *dns.Msg, mTTL uint32) error {

ttlDuration := convertToTTLDuration(m, mTTL)
if _, ok := c.table[s]; !ok {
Expand Down

0 comments on commit 3b0f93b

Please sign in to comment.