Skip to content
Permalink
Browse files

wip: zone reload debugging

  • Loading branch information...
abh committed Jul 17, 2018
1 parent b657409 commit 2ba0ddd4e3b8b2a91eb2cf7a1136c81b9ba4e6a2
Showing with 6 additions and 8 deletions.
  1. +3 −3 Makefile
  2. +3 −5 zones/muxmanager.go
@@ -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

@@ -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
}

0 comments on commit 2ba0ddd

Please sign in to comment.
You can’t perform that action at this time.