Revert some NowFunc() modification in #2142 which are only for metrics

This commit is contained in:
lrita 2019-11-04 14:16:25 +08:00
parent 179760d834
commit 3a8c23169b
3 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ func updateTimeStampForCreateCallback(scope *Scope) {
// createCallback the callback used to insert data into database
func createCallback(scope *Scope) {
if !scope.HasError() {
defer scope.trace(scope.db.nowFunc())
defer scope.trace(NowFunc())
var (
columns, placeholders []string

View File

@ -24,7 +24,7 @@ func queryCallback(scope *Scope) {
return
}
defer scope.trace(scope.db.nowFunc())
defer scope.trace(NowFunc())
var (
isSlice, isPtr bool

View File

@ -358,7 +358,7 @@ func (scope *Scope) Raw(sql string) *Scope {
// Exec perform generated SQL
func (scope *Scope) Exec() *Scope {
defer scope.trace(scope.db.nowFunc())
defer scope.trace(NowFunc())
if !scope.HasError() {
if result, err := scope.SQLDB().Exec(scope.SQL, scope.SQLVars...); scope.Err(err) == nil {
@ -932,7 +932,7 @@ func (scope *Scope) updatedAttrsWithValues(value interface{}) (results map[strin
}
func (scope *Scope) row() *sql.Row {
defer scope.trace(scope.db.nowFunc())
defer scope.trace(NowFunc())
result := &RowQueryResult{}
scope.InstanceSet("row_query_result", result)
@ -942,7 +942,7 @@ func (scope *Scope) row() *sql.Row {
}
func (scope *Scope) rows() (*sql.Rows, error) {
defer scope.trace(scope.db.nowFunc())
defer scope.trace(NowFunc())
result := &RowsQueryResult{}
scope.InstanceSet("row_query_result", result)