Archived
1
0

fix error message spam

This commit is contained in:
Jeff 2017-08-03 12:07:12 -04:00
parent d301021122
commit bdabd25867
2 changed files with 12 additions and 5 deletions

View File

@ -128,10 +128,16 @@ func (self *nullHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if len(hash) == 0 { if len(hash) == 0 {
goto notfound goto notfound
} }
msg, err := self.database.GetMessageIDByHash(hash) msg, err := self.database.GetMessageIDByHash(hash)
if err != nil { if err != nil {
goto notfound 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) template.genThread(self.attachments, self.requireCaptcha, msg, self.prefix, self.name, w, self.database, isjson)
return return
} }

View File

@ -292,11 +292,12 @@ func (self *templateEngine) genThread(allowFiles, requireCaptcha bool, root Arti
newsgroup := root.Newsgroup() newsgroup := root.Newsgroup()
msgid := root.MessageID() msgid := root.MessageID()
if !db.HasArticleLocal(msgid) { /*
log.Println("don't have", msgid, "locally, not regenerating") if !db.HasArticleLocal(msgid) {
return log.Println("don't have", msgid, "locally, not regenerating")
} return
}
*/
t, err := db.GetThreadModel(prefix, msgid) t, err := db.GetThreadModel(prefix, msgid)
if err == nil { if err == nil {
if json { if json {