From bdabd258674fec30c11701baee0eeabc205c9d55 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 3 Aug 2017 12:07:12 -0400 Subject: [PATCH] fix error message spam --- contrib/backends/srndv2/src/srnd/null_cache.go | 6 ++++++ contrib/backends/srndv2/src/srnd/templates.go | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/null_cache.go b/contrib/backends/srndv2/src/srnd/null_cache.go index 22ee020..50d8aa5 100644 --- a/contrib/backends/srndv2/src/srnd/null_cache.go +++ b/contrib/backends/srndv2/src/srnd/null_cache.go @@ -128,10 +128,16 @@ func (self *nullHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if len(hash) == 0 { goto notfound } + msg, err := self.database.GetMessageIDByHash(hash) if err != nil { goto notfound } + + if !self.database.HasArticleLocal(msg.MessageID()) { + goto notfound + } + template.genThread(self.attachments, self.requireCaptcha, msg, self.prefix, self.name, w, self.database, isjson) return } diff --git a/contrib/backends/srndv2/src/srnd/templates.go b/contrib/backends/srndv2/src/srnd/templates.go index 92f1e9f..23ebd75 100644 --- a/contrib/backends/srndv2/src/srnd/templates.go +++ b/contrib/backends/srndv2/src/srnd/templates.go @@ -292,11 +292,12 @@ func (self *templateEngine) genThread(allowFiles, requireCaptcha bool, root Arti newsgroup := root.Newsgroup() msgid := root.MessageID() - if !db.HasArticleLocal(msgid) { - log.Println("don't have", msgid, "locally, not regenerating") - return - } - + /* + if !db.HasArticleLocal(msgid) { + log.Println("don't have", msgid, "locally, not regenerating") + return + } + */ t, err := db.GetThreadModel(prefix, msgid) if err == nil { if json {