Skip to content

Commit 3b0f93b

Browse files
committed
Format code; Fix default config
1 parent 25ceeb8 commit 3b0f93b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

config.sample.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ hostsFile:
3838
minimumTTL: 0
3939
domainTTLFile: ./domain_ttl_sample
4040
cacheSize: 0
41-
cacheRedisUrl: redis://localhost:6379/0
42-
cacheRedisConnectionPoolSize: 10
41+
cacheRedisUrl:
42+
cacheRedisConnectionPoolSize:
4343
rejectQType:
4444
- 255

core/cache/cache.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ func (c *Cache) InsertMessage(s string, m *dns.Msg, mTTL uint32) {
125125
} else {
126126
err = c.InsertMessageToRedis(s, m, mTTL)
127127
}
128-
if err!=nil{
129-
log.Warnf("Insert cache failed: %s", s, err)
130-
}else {
128+
if err != nil {
129+
log.Warn("Insert cache failed", s, err)
130+
} else {
131131
log.Debugf("Cached: %s", s)
132132
}
133133
}
134134

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

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

0 commit comments

Comments
 (0)