patches being sent again when requested
This commit is contained in:
parent
a099bbd3e6
commit
873cb39932
|
@ -32,10 +32,9 @@ func sendPendingPatches(pb *forgepb.Patches, reqPB *httppb.HttpRequest) *forgepb
|
|||
func sendPendingPatchsets(pb *forgepb.Patchsets, reqPB *httppb.HttpRequest) *forgepb.Patchsets {
|
||||
allPatchsetsPB := new(forgepb.Patchsets)
|
||||
for pset := range me.forge.Patchsets.IterAll() {
|
||||
if pset.Name == "forge auto submit" {
|
||||
reqPB.Errors = append(reqPB.Errors, log.Sprintf("adding %s with len=%d", pset.Name, pset.Patches.Len()))
|
||||
allPatchsetsPB.Append(pset)
|
||||
}
|
||||
}
|
||||
return allPatchsetsPB
|
||||
}
|
||||
|
||||
|
|
12
http.go
12
http.go
|
@ -48,8 +48,15 @@ func whoSent(r *http.Request) string {
|
|||
return log.Sprintf("%s\t%s", getClientIP(r), r.Header.Get("hostname"))
|
||||
}
|
||||
|
||||
func logReqPB(pb *httppb.HttpRequest) {
|
||||
log.Info("LOG: httppb.HttpRequest Errors START:")
|
||||
log.Info(strings.Join(pb.Errors, "\n"))
|
||||
log.Info("LOG: httppb.HttpRequest Errors END")
|
||||
}
|
||||
|
||||
func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||
reqPB, err := httppb.ReqToPB(r)
|
||||
reqPB.Errors = append(reqPB.Errors, fmt.Sprintf("START: Got %d bytes from the client", len(reqPB.Body)))
|
||||
if err != nil {
|
||||
log.Info("something crazy err", err)
|
||||
}
|
||||
|
@ -93,6 +100,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
log.Info("Oh well, Send to client failed. err =", err)
|
||||
}
|
||||
// todo: logReq(reqPB)
|
||||
logReqPB(reqPB)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -116,6 +124,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
me.forge.SavePatchsets()
|
||||
// todo: logReq(reqPB)
|
||||
logReqPB(reqPB)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -134,10 +143,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
if err := result.SendReply(w, reqPB); err != nil {
|
||||
log.Info("Oh well, Send to client failed. err =", err)
|
||||
}
|
||||
log.Info("Send to client seems to have worked. errors:", reqPB.Errors)
|
||||
me.forge.SavePatchsets()
|
||||
// todo: logReq(reqPB)
|
||||
logReqPB(reqPB)
|
||||
return
|
||||
}
|
||||
logReqPB(reqPB)
|
||||
|
||||
/*
|
||||
if route == "/patchset" {
|
||||
|
|
Loading…
Reference in New Issue