Cancel the context timeout AFTER errors are checked

This commit is contained in:
Tobie Morgan Hitchcock 2017-12-06 13:21:12 +00:00
parent 6d8686138a
commit 548995e935

View file

@ -249,8 +249,8 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf
if tim := ctx.Err(); err == nil && tim != nil { if tim := ctx.Err(); err == nil && tim != nil {
res, err = nil, &TimerError{timer: stm.Duration()} res, err = nil, &TimerError{timer: stm.Duration()}
} }
canc()
}() }()
defer canc()
} }
} }