Skip to content

Commit 00af94d

Browse files
committed
Bumped v0.8.2
Signed-off-by: Vishal Rana <[email protected]>
1 parent 4d5c247 commit 00af94d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cube.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ func (c *Cube) Dispatch() error {
105105
if err != nil {
106106
return err
107107
}
108-
return ce
108+
if ce.Code != 0 {
109+
return ce
110+
}
111+
112+
return nil
109113
}
110114

111115
// Start starts recording an HTTP request.
@@ -145,7 +149,7 @@ func (c *Cube) Stop(r *CubeRequest, status int, size int64) {
145149
r.Latency = int64(time.Now().Sub(r.Time))
146150

147151
// Dispatch batch
148-
if c.requestsLength() >= c.BatchSize {
152+
if c.requestsLength() >= c.BatchSize || status >= 500 && status < 600 {
149153
go func() {
150154
if err := c.Dispatch(); err != nil {
151155
c.logger.Error(err)

0 commit comments

Comments
 (0)