mirror of
https://github.com/zhengkai/orca.git
synced 2026-02-12 13:42:25 +08:00
up
This commit is contained in:
@@ -3,19 +3,27 @@ package core
|
||||
import (
|
||||
"net/http"
|
||||
"project/metrics"
|
||||
"project/util"
|
||||
)
|
||||
|
||||
// WebHandle ...
|
||||
func (c *Core) WebHandle(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
p, hash, err := req(w, r)
|
||||
p, err := req(w, r)
|
||||
if err != nil {
|
||||
metrics.ReqFailCount()
|
||||
return
|
||||
}
|
||||
metrics.ReqBytes(len(p.Body))
|
||||
|
||||
pr := c.add(hash, p)
|
||||
pr := c.add(p, r)
|
||||
|
||||
go func() {
|
||||
reqFile := util.CacheName(p.Hash()) + `-req.json`
|
||||
if !util.FileExists(reqFile) {
|
||||
util.WriteFile(reqFile, p.Body)
|
||||
}
|
||||
}()
|
||||
|
||||
pr.wait()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user