diff --git a/install/awwkoala.init b/install/awwkoala.init old mode 100755 new mode 100644 diff --git a/install/awwkoala.nginx b/install/awwkoala.nginx old mode 100755 new mode 100644 diff --git a/static/img/awwkoala.png b/static/img/awwkoala.png old mode 100755 new mode 100644 diff --git a/static/img/gomascot.png b/static/img/gomascot.png old mode 100755 new mode 100644 diff --git a/static/img/nginx.png b/static/img/nginx.png old mode 100755 new mode 100644 diff --git a/static/img/raspberrypi.png b/static/img/raspberrypi.png old mode 100755 new mode 100644 diff --git a/utils.go b/utils.go index f12fa3c..1340c97 100644 --- a/utils.go +++ b/utils.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "io/ioutil" "log" "math/rand" @@ -89,9 +90,13 @@ func getImportantVersions(p WikiData) []versionsInfo { // defer timeTrack(time.Now(), "getImportantVersions") m := map[int]int{} lastTime := time.Now().AddDate(0, -1, 0) + totalTime := time.Now().Sub(time.Now()) for i := range p.Diffs { parsedTime, _ := time.Parse(time.ANSIC, p.Timestamps[i]) duration := parsedTime.Sub(lastTime) + if duration.Minutes() < 3 { + totalTime += duration + } m[i] = int(duration.Seconds()) if i > 0 { m[i-1] = m[i] @@ -133,6 +138,7 @@ func getImportantVersions(p WikiData) []versionsInfo { for _, nn := range importantVersions { r = append(r, versionsInfo{p.Timestamps[nn], nn}) } + fmt.Println(totalTime) return r }