Removed unused values

This commit is contained in:
Mael G. 2020-12-13 14:43:31 -04:00
parent 9394aeeb9d
commit c17d650520
4 changed files with 12 additions and 2 deletions

View file

@ -39,7 +39,7 @@ func GetRecord(entry Record) Record {
result, sqlErr = sqlCheckForRecord(redisKey, entry.Fqdn, entry) result, sqlErr = sqlCheckForRecord(redisKey, entry.Fqdn, entry)
if sqlErr == 1 { if sqlErr == 1 {
logrus.Debug("QUERIES : Check for wildcard reverse in MySQL") logrus.Debug("QUERIES : Check for wildcard reverse in MySQL")
result, redisErr = sqlCheckForReverse6Wildcard(redisKey, entry.Fqdn, entry) result, _ = sqlCheckForReverse6Wildcard(redisKey, entry.Fqdn, entry)
} }
} }
@ -68,7 +68,7 @@ func GetRecord(entry Record) Record {
if sqlErr == 1 { if sqlErr == 1 {
//Check for wildcard record in mysql //Check for wildcard record in mysql
logrus.Debug("QUERIES : Check for wildcard in MSQL") logrus.Debug("QUERIES : Check for wildcard in MSQL")
result, sqlErr = sqlCheckForRecord(redismdKey, fmt.Sprint(mainDomainKey), entry) result, _ = sqlCheckForRecord(redismdKey, fmt.Sprint(mainDomainKey), entry)
} }
} }
} }

View file

@ -24,6 +24,7 @@ func RedisDatabase(conf *Conf) *redis.Client {
//Test Redis connection //Test Redis connection
err := rdb.Set(ctx, "alive", 1, 0).Err() err := rdb.Set(ctx, "alive", 1, 0).Err()
CheckErr(err)
alive, err := rdb.Get(ctx, "alive").Result() alive, err := rdb.Get(ctx, "alive").Result()
CheckErr(err) CheckErr(err)
if alive != "1" { if alive != "1" {

View file

@ -66,6 +66,7 @@ func sqlCheckForReverse6Wildcard(redisKey string, dKey string, entry Record) (Re
returnedEntry := entry returnedEntry := entry
results, err := DB.Query("SELECT id, content, name FROM records WHERE name LIKE '*%.ip6.arpa.';") results, err := DB.Query("SELECT id, content, name FROM records WHERE name LIKE '*%.ip6.arpa.';")
DbgErr(err)
for results.Next() { for results.Next() {
err = results.Scan(&returnedEntry.Id, &returnedEntry.Content, &returnedEntry.Fqdn) err = results.Scan(&returnedEntry.Id, &returnedEntry.Content, &returnedEntry.Fqdn)

View file

@ -17,6 +17,14 @@ func CheckErr(err error) {
} }
} }
//Only used for non fatal errors.
func DbgErr(err error) {
if err != nil {
log.Errorf("%s\n ", err.Error())
panic(err)
}
}
func InitLogger(conf *Conf) { func InitLogger(conf *Conf) {
var logLevel = logrus.InfoLevel var logLevel = logrus.InfoLevel