Remove dead code
This commit is contained in:
30
app.go
30
app.go
@@ -6,10 +6,8 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gobuffalo/packr"
|
||||
)
|
||||
@@ -17,12 +15,7 @@ import (
|
||||
// VersionString will be set through ldflags, contains current version
|
||||
var VersionString = "undefined"
|
||||
|
||||
func cleanup() {
|
||||
writeStats()
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := make(chan os.Signal, 1)
|
||||
log.Printf("AdGuard DNS web interface backend, version %s\n", VersionString)
|
||||
box := packr.NewBox("build/static")
|
||||
{
|
||||
@@ -121,31 +114,8 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = loadStats()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
signal.Notify(c, os.Interrupt)
|
||||
go func() {
|
||||
<-c
|
||||
cleanup()
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
for range time.Tick(time.Hour * 24) {
|
||||
err := writeStats()
|
||||
if err != nil {
|
||||
log.Printf("Couldn't write stats: %s", err)
|
||||
// try later on next iteration, don't abort
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.BindPort))
|
||||
|
||||
runStatsCollectors()
|
||||
runFilterRefreshers()
|
||||
|
||||
http.Handle("/", optionalAuthHandler(http.FileServer(box)))
|
||||
|
||||
Reference in New Issue
Block a user