Browse Source

Configurable refresh

Loweel 4 years ago
parent
commit
157e095661
2 changed files with 3 additions and 3 deletions
  1. 0 3
      main.go
  2. 3 0
      matrix.go

+ 0 - 3
main.go

@@ -7,7 +7,6 @@ import (
 	"net/url"
 	"os"
 	"strconv"
-	"time"
 )
 
 func main() {
@@ -37,8 +36,6 @@ func main() {
 	}
 	log.Println("Minimum request to learn: ", Maturity)
 
-	
-
 	proxy := httputil.NewSingleHostReverseProxy(remote)
 	http.HandleFunc("/", handler(proxy))
 	err = http.ListenAndServe(pport, nil)

+ 3 - 0
matrix.go

@@ -3,6 +3,7 @@ package main
 import (
 	"fmt"
 	"log"
+	"os"
 	"sort"
 	"strconv"
 	"strings"
@@ -246,6 +247,8 @@ func (c *ByClassifier) readStatsTokens() {
 //CleanMEH cleans periodically the spurious tokens.
 func (c *ByClassifier) CleanMEH() {
 
+	var err error
+
 	ProxyFlow.refreshtime, err = time.ParseDuration(os.Getenv("REFRESHTIME"))
 	if err != nil {
 		ProxyFlow.refreshtime = time.Duration(48 * time.Hour)