Fix filewatch example

Use last modified time when the time is parsed without error. This prevents an
extra file read at start of watch for a connection.

Fixes #125.
This commit is contained in:
Gary Burd 2016-04-21 17:30:17 -07:00
parent e2e3d8414d
commit 6b3d49710b
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ func serveWs(w http.ResponseWriter, r *http.Request) {
}
var lastMod time.Time
if n, err := strconv.ParseInt(r.FormValue("lastMod"), 16, 64); err != nil {
if n, err := strconv.ParseInt(r.FormValue("lastMod"), 16, 64); err == nil {
lastMod = time.Unix(0, n)
}