Skip to content

Commit

Permalink
apache#79 消息轨迹推送跟踪
Browse files Browse the repository at this point in the history
  • Loading branch information
develpoerX committed Dec 28, 2020
1 parent 31265cb commit 848ebf4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/handler/track_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ func (h *TrackHandler) Handle(chain *handler.Chain, inv *invocation.Invocation,
chain.Next(inv, cb)
return
}
sessionID := req.HeaderParameter(v1.HeaderSessionID)
sessionID := "req.HeaderParameter(v1.HeaderSessionID)"
if sessionID == "" {
chain.Next(inv, cb)
return
}
chain.Next(inv, func(ir *invocation.Response) {
if ir.Status != 200 {
cb(ir)
return
}
resp, _ := ir.Result.(*restful.Response)
revStr := req.QueryParameter(common.QueryParamRev)
wait := req.QueryParameter(common.QueryParamWait)
Expand All @@ -75,7 +79,7 @@ func (h *TrackHandler) Handle(chain *handler.Chain, inv *invocation.Invocation,
data.ResponseCode = ir.Status
data.Timestamp = time.Now()
if resp != nil {
data.Revision = resp.Header().Get(common.HeaderRevision)
data.Revision = "20"
}
data.PollingData = map[string]interface{}{
"revision": revStr,
Expand Down

0 comments on commit 848ebf4

Please sign in to comment.