mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Fix GUI files modtime (ish...)
This commit is contained in:
parent
84d7452f9e
commit
6b02f9e44f
5
build.sh
5
build.sh
@ -3,11 +3,6 @@
|
||||
version=$(git describe --always)
|
||||
buildDir=dist
|
||||
|
||||
if [[ $1 == "-f" ]] ; then
|
||||
fast=yes
|
||||
shift
|
||||
fi
|
||||
|
||||
if [[ $fast != yes ]] ; then
|
||||
go get -d
|
||||
go test ./...
|
||||
|
13
gui.go
13
gui.go
@ -6,7 +6,6 @@ import (
|
||||
"log"
|
||||
"mime"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sync"
|
||||
@ -32,15 +31,9 @@ func startGUI(addr string, m *model.Model) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
var modt time.Time
|
||||
fi, err := os.Stat(os.Args[0])
|
||||
if err != nil {
|
||||
modt = fi.ModTime()
|
||||
}
|
||||
|
||||
go func() {
|
||||
mr := martini.New()
|
||||
mr.Use(embeddedStatic(fs, modt.UTC().Format(http.TimeFormat)))
|
||||
mr.Use(embeddedStatic(fs))
|
||||
mr.Use(martini.Recovery())
|
||||
mr.Action(router.Handle)
|
||||
mr.Map(m)
|
||||
@ -136,7 +129,9 @@ func restGetSystem(w http.ResponseWriter) {
|
||||
json.NewEncoder(w).Encode(res)
|
||||
}
|
||||
|
||||
func embeddedStatic(fs map[string][]byte, modt string) interface{} {
|
||||
func embeddedStatic(fs map[string][]byte) interface{} {
|
||||
var modt = time.Now().UTC().Format(http.TimeFormat)
|
||||
|
||||
return func(res http.ResponseWriter, req *http.Request, log *log.Logger) {
|
||||
file := req.URL.Path
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user