release gorutines
This commit is contained in:
parent
73cfcdce55
commit
4b9c72f440
|
@ -131,6 +131,8 @@ func (ueqs queues) Close(sid string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close(q.Queue)
|
||||||
|
|
||||||
delete(ueqs, sid)
|
delete(ueqs, sid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -365,15 +365,19 @@ func (sessions *wSessions) New(httpSession *sessions.Session, sid string) *WideS
|
||||||
defer util.Recover()
|
defer util.Recover()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
ch := SessionWS[sid]
|
||||||
|
if nil == ch {
|
||||||
|
return // release this gorutine
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case event := <-watcher.Events:
|
case event := <-watcher.Events:
|
||||||
path := event.Name
|
path := event.Name
|
||||||
dir := filepath.Dir(path)
|
dir := filepath.Dir(path)
|
||||||
|
|
||||||
ch := SessionWS[sid]
|
ch = SessionWS[sid]
|
||||||
|
|
||||||
if nil == ch {
|
if nil == ch {
|
||||||
break
|
return // release this gorutine
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.Op&fsnotify.Create == fsnotify.Create {
|
if event.Op&fsnotify.Create == fsnotify.Create {
|
||||||
|
|
Loading…
Reference in New Issue