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) {
|
||||
f, err := os.Open(path.Join(ServerDir, "log"))
|
||||
logfn := path.Join(ServerDir, "log")
|
||||
|
||||
f, err := os.Open(logfn)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -41,6 +43,7 @@ func tail(w http.ResponseWriter, pos int64) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
defer watcher.Close()
|
||||
watcher.Add(logfn)
|
||||
|
||||
for {
|
||||
printid := false
|
||||
|
|
|
@ -27,6 +27,10 @@ var gecos string
|
|||
var logq chan Message
|
||||
|
||||
func isChannel(s string) bool {
|
||||
if (s == "") {
|
||||
return false
|
||||
}
|
||||
|
||||
switch s[0] {
|
||||
case '#', '&', '!', '+', '.', '-':
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue