From a4c8de953af24ba3a0cbd7bdce38ac6a1b7e10f7 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 29 Dec 2017 11:06:59 -0500 Subject: [PATCH] don't download articles if we already have it locally --- contrib/backends/srndv2/src/srnd/nntp.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index b20bee0..440d7e3 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1433,6 +1433,10 @@ func (self *nntpConnection) scrapeServer(daemon *NNTPDaemon, conn *textproto.Con // ask for an article from the remote server // feed it to the daemon if we get it func (self *nntpConnection) requestArticle(daemon *NNTPDaemon, conn *textproto.Conn, msgid string) (err error) { + if daemon.store.HasArticle(msgid) { + log.Println("already have", msgid, "so not requesting it") + return + } // send command err = conn.PrintfLine("ARTICLE %s", msgid) // read response