auto update StaticResourceVersion when starting

This commit is contained in:
Liang Ding 2014-11-18 16:56:33 +08:00
parent be8fc6fb33
commit b8cba6f400
2 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import (
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"text/template"
"time"
@ -316,6 +317,7 @@ func Load(confPath, confIP, confPort, confServer, confChannel string, confDocker
// Static Server
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{IP}", Wide.IP, 1)
Wide.StaticResourceVersion = strings.Replace(Wide.StaticResourceVersion, "${time}", strconv.FormatInt(time.Now().UnixNano(), 10), 1)
// Channels
Wide.EditorChannel = strings.Replace(Wide.EditorChannel, "{IP}", Wide.IP, 1)

View File

@ -8,7 +8,7 @@
"ShellChannel": "ws://{IP}:{Port}",
"SessionChannel": "ws://{IP}:{Port}",
"HTTPSessionMaxAge": 86400,
"StaticResourceVersion": "201411171800",
"StaticResourceVersion": "${time}",
"MaxProcs": 4,
"RuntimeMode": "dev",
"WD": "${pwd}",