Skip to content

Commit

Permalink
small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kapishmalik committed Apr 9, 2024
1 parent afa673d commit 5be2f69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,16 @@ func (action *Action) Execute(pair *models.RequestResponsePair, journalIDChannel
req.Header.Add("X-CORRELATION-ID", correlationID)

resp, err := http.DefaultClient.Do(req)
completionTime := time.Now()

if err != nil {
journal.UpdatePostServeActionDetailsInJournal(journalID, pair.Response.PostServeAction, correlationID, invokedTime, completionTime, 0)
log.WithFields(log.Fields{
"error": err.Error(),
}).Error("Error when communicating with remote post serve action")
return err
}

completionTime := time.Now()
journal.UpdatePostServeActionDetailsInJournal(journalID, pair.Response.PostServeAction, correlationID, invokedTime, completionTime, resp.StatusCode)
if resp.StatusCode != 200 {
log.Error("Remote post serve action did not process payload")
Expand Down

0 comments on commit 5be2f69

Please sign in to comment.