Improve sql query requests timing

This commit is contained in:
Tobie Morgan Hitchcock 2017-02-09 20:45:45 +00:00
parent dd230dca56
commit 7f0ea653b8

View file

@ -168,6 +168,7 @@ func Process(ctx *fibre.Context, ast *sql.Query, vars map[string]interface{}) (o
func (e *executor) execute(quit <-chan bool, send chan<- *Response) {
var err error
var now time.Time
var rsp *Response
var buf []*Response
var res []interface{}
@ -239,7 +240,7 @@ func (e *executor) execute(quit <-chan bool, send chan<- *Response) {
// next statement is not ignored.
if e.txn == nil {
err = nil
err, now = nil, time.Now()
}
// Check to see if the current statement is
@ -258,12 +259,6 @@ func (e *executor) execute(quit <-chan bool, send chan<- *Response) {
continue
}
// This is not a TRANSACTION statement and
// therefore we must time the execution speed
// and process the statement response.
now := time.Now()
// If an error has occured and we are inside
// a global transaction, then ignore all
// subsequent statements in the transaction.