mirror of https://github.com/nealey/spongy
Collectly handle restarts
This commit is contained in:
parent
8e297e9bf1
commit
ab7701eae0
10
Makefile
10
Makefile
|
@ -6,8 +6,14 @@ ICONS += app/icon-256.png
|
|||
|
||||
all: icons serverside
|
||||
|
||||
serverside:
|
||||
GOPATH=$(CURDIR) go build -v all
|
||||
serverside: spongy spongy.cgi
|
||||
|
||||
spongy: src/spongy/spongy.go
|
||||
GOPATH=$(CURDIR) go build -v $@
|
||||
|
||||
spongy.cgi: src/spongy.cgi/spongy.cgi.go
|
||||
GOPATH=$(CURDIR) go build -v $@
|
||||
chmod +s $@
|
||||
|
||||
icons: $(ICONS)
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ func tail(w http.ResponseWriter, filename string, pos int64) {
|
|||
parts := strings.Split(t, " ")
|
||||
if (len(parts) >= 4) && (parts[2] == "NEXTLOG") {
|
||||
watcher.Remove(filepath)
|
||||
filename = parts[4]
|
||||
filename = parts[3]
|
||||
filepath = path.Join(NetworkDir, filename)
|
||||
f.Close()
|
||||
f, err = os.Open(filepath)
|
||||
|
@ -83,6 +83,7 @@ func tail(w http.ResponseWriter, filename string, pos int64) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
watcher.Add(filepath)
|
||||
pos = 0
|
||||
}
|
||||
fmt.Fprintf(w, "data: %s\n", t)
|
||||
printid = true
|
||||
|
|
Loading…
Reference in New Issue