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" "os/exec"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strconv"
"strings" "strings"
"text/template" "text/template"
"time" "time"
@ -316,6 +317,7 @@ func Load(confPath, confIP, confPort, confServer, confChannel string, confDocker
// Static Server // Static Server
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{IP}", Wide.IP, 1) 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 // Channels
Wide.EditorChannel = strings.Replace(Wide.EditorChannel, "{IP}", Wide.IP, 1) Wide.EditorChannel = strings.Replace(Wide.EditorChannel, "{IP}", Wide.IP, 1)

View File

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