Browse Source

wip: zone reload debugging

Ask Bjørn Hansen 7 years ago
parent
commit
2ba0ddd4e3
2 changed files with 6 additions and 8 deletions
  1. 3 3
      Makefile
  2. 3 5
      zones/muxmanager.go

+ 3 - 3
Makefile

@@ -1,7 +1,7 @@
 
 # where to rsync builds
 DIST?=dist/publish
-DISTSUB=2018/04
+DISTSUB=2018/07
 
 test: .PHONY
 	go test -v $(shell go list ./... | grep -v /vendor/)
@@ -22,12 +22,12 @@ devel:
 bench:
 	go test -check.b -check.bmem
 
-TARS=$(wildcard geodns-*-*.tar)
+TARS=$(wildcard dist/geodns-*-*.tar)
 
 push: $(TARS) tmp-install.sh
 	#rsync -avz tmp-install.sh $(TARS)  x3.dev:webtmp/2018/04/
 	rsync --exclude publish tmp-install.sh $(TARS) $(DIST)/$(DISTSUB)/
-	$(DIST)/push
+	$(DIST)/../push
 
 builds: linux-build linux-build-i386 freebsd-build push
 

+ 3 - 5
zones/muxmanager.go

@@ -10,8 +10,6 @@ import (
 	"strings"
 	"time"
 
-	"github.com/abh/geodns/applog"
-
 	"github.com/miekg/dns"
 )
 
@@ -95,10 +93,10 @@ func (mm *MuxManager) reload() error {
 		if _, ok := mm.lastRead[zoneName]; !ok || file.ModTime().After(mm.lastRead[zoneName].time) {
 			modTime := file.ModTime()
 			if ok {
-				applog.Printf("Reloading %s\n", fileName)
+				log.Printf("Reloading %s\n", fileName)
 				mm.lastRead[zoneName].time = modTime
 			} else {
-				applog.Printf("Reading new file %s\n", fileName)
+				log.Printf("Reading new file %s\n", fileName)
 				mm.lastRead[zoneName] = &zoneReadRecord{time: modTime}
 			}
 
@@ -127,7 +125,7 @@ func (mm *MuxManager) reload() error {
 
 			sha256 := sha256File(filename)
 			if mm.lastRead[zoneName].hash == sha256 {
-				applog.Printf("Skipping new file %s as hash is unchanged\n", filename)
+				log.Printf("Skipping new file %s as hash is unchanged\n", filename)
 				continue
 			}