mirror of https://github.com/nealey/spongy
inotify working, more responsive
This commit is contained in:
parent
2faee3164e
commit
2a0c9231d7
|
@ -30,7 +30,9 @@ func ReadString(fn string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func tail(w http.ResponseWriter, pos int64) {
|
func tail(w http.ResponseWriter, pos int64) {
|
||||||
f, err := os.Open(path.Join(ServerDir, "log"))
|
logfn := path.Join(ServerDir, "log")
|
||||||
|
|
||||||
|
f, err := os.Open(logfn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -41,6 +43,7 @@ func tail(w http.ResponseWriter, pos int64) {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
defer watcher.Close()
|
defer watcher.Close()
|
||||||
|
watcher.Add(logfn)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
printid := false
|
printid := false
|
||||||
|
|
|
@ -27,6 +27,10 @@ var gecos string
|
||||||
var logq chan Message
|
var logq chan Message
|
||||||
|
|
||||||
func isChannel(s string) bool {
|
func isChannel(s string) bool {
|
||||||
|
if (s == "") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
switch s[0] {
|
switch s[0] {
|
||||||
case '#', '&', '!', '+', '.', '-':
|
case '#', '&', '!', '+', '.', '-':
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue