|
|
@ -153,7 +153,6 @@ func (db *commonSqlConn) ExecCtx(ctx context.Context, q string, args ...interfac
|
|
|
|
result, err = exec(ctx, conn, q, args...)
|
|
|
|
result, err = exec(ctx, conn, q, args...)
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}, db.acceptable)
|
|
|
|
}, db.acceptable)
|
|
|
|
|
|
|
|
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
metricReqErr.Inc("Exec", "breaker")
|
|
|
|
metricReqErr.Inc("Exec", "breaker")
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -190,7 +189,6 @@ func (db *commonSqlConn) PrepareCtx(ctx context.Context, query string) (stmt Stm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}, db.acceptable)
|
|
|
|
}, db.acceptable)
|
|
|
|
|
|
|
|
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
metricReqErr.Inc("Prepare", "breaker")
|
|
|
|
metricReqErr.Inc("Prepare", "breaker")
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -281,7 +279,6 @@ func (db *commonSqlConn) TransactCtx(ctx context.Context, fn func(context.Contex
|
|
|
|
err = db.brk.DoWithAcceptable(func() error {
|
|
|
|
err = db.brk.DoWithAcceptable(func() error {
|
|
|
|
return transact(ctx, db, db.beginTx, fn)
|
|
|
|
return transact(ctx, db, db.beginTx, fn)
|
|
|
|
}, db.acceptable)
|
|
|
|
}, db.acceptable)
|
|
|
|
|
|
|
|
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
metricReqErr.Inc("Transact", "breaker")
|
|
|
|
metricReqErr.Inc("Transact", "breaker")
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -315,7 +312,6 @@ func (db *commonSqlConn) queryRows(ctx context.Context, scanner func(*sql.Rows)
|
|
|
|
}, func(err error) bool {
|
|
|
|
}, func(err error) bool {
|
|
|
|
return qerr == err || db.acceptable(err)
|
|
|
|
return qerr == err || db.acceptable(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
if err == breaker.ErrServiceUnavailable {
|
|
|
|
metricReqErr.Inc("queryRows", "breaker")
|
|
|
|
metricReqErr.Inc("queryRows", "breaker")
|
|
|
|
}
|
|
|
|
}
|
|
|
|