fix error result cache something else

This commit is contained in:
Zheng Kai
2023-06-28 16:23:14 +08:00
parent 645873a6d1
commit 770510ccdc
5 changed files with 61 additions and 28 deletions

View File

@@ -7,7 +7,7 @@ import (
"project/util"
)
func (c *Core) getAB(p *pb.Req, r *http.Request) (ab []byte, cached bool, err error) {
func (c *Core) getAB(p *pb.Req, r *http.Request) (ab []byte, cached bool, pr *row, err error) {
canCache := p.Method != http.MethodGet && p.Method != http.MethodDelete
@@ -22,7 +22,7 @@ func (c *Core) getAB(p *pb.Req, r *http.Request) (ab []byte, cached bool, err er
}
}
pr, cached := c.add(p, r)
pr, cached = c.add(p, r)
if canCache {
go func() {
@@ -51,6 +51,7 @@ func req(w http.ResponseWriter, r *http.Request) (p *pb.Req, err error) {
if url == `/favicon.ico` {
err = errSkip
err500(w)
return
}