Archived
1
0

make backend die when streaming is done

This commit is contained in:
Jeff Becker 2017-04-23 08:30:28 -04:00
parent cfaa96b82c
commit 942294317a

View File

@ -1225,16 +1225,13 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string
func (self *nntpConnection) startStreaming(daemon *NNTPDaemon, reader bool, conn *textproto.Conn) { func (self *nntpConnection) startStreaming(daemon *NNTPDaemon, reader bool, conn *textproto.Conn) {
self.keepalive = time.NewTicker(time.Minute) self.keepalive = time.NewTicker(time.Minute)
defer self.keepalive.Stop() defer self.keepalive.Stop()
for {
err := self.handleStreaming(daemon, conn) err := self.handleStreaming(daemon, conn)
if err == nil { if err == nil {
log.Println(self.name, "done with streaming") log.Println(self.name, "done with streaming")
return
} else { } else {
log.Println(self.name, "error while streaming:", err) log.Println(self.name, "error while streaming:", err)
} }
} }
}
// scrape all posts in a newsgroup // scrape all posts in a newsgroup
// download ones we do not have // download ones we do not have