Skip to content

Commit

Permalink
:refactor: Rename ambiguous function in internal/db/rdb/mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
rinx committed Mar 16, 2021
1 parent 545adcf commit 3217dd4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions internal/db/rdb/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (m *mySQLClient) Open(ctx context.Context) (err error) {
func (m *mySQLClient) Ping(ctx context.Context) (err error) {
if m.session == nil {
err = errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return err
}
pctx, cancel := context.WithTimeout(ctx, m.initialPingTimeLimit)
Expand Down Expand Up @@ -183,7 +183,7 @@ func (m *mySQLClient) Ping(ctx context.Context) (err error) {
func (m *mySQLClient) Close(ctx context.Context) (err error) {
if m.session == nil {
err = errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
m.connected.Store(false)
return err
}
Expand All @@ -205,7 +205,7 @@ func (m *mySQLClient) GetVector(ctx context.Context, uuid string) (Vector, error

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return nil, err
}

Expand Down Expand Up @@ -238,7 +238,7 @@ func (m *mySQLClient) GetIPs(ctx context.Context, uuid string) ([]string, error)

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return nil, err
}

Expand Down Expand Up @@ -281,7 +281,7 @@ func (m *mySQLClient) SetVector(ctx context.Context, vec Vector) error {

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return err
}

Expand Down Expand Up @@ -338,7 +338,7 @@ func (m *mySQLClient) SetVectors(ctx context.Context, vecs ...Vector) error {

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return err
}

Expand Down Expand Up @@ -398,7 +398,7 @@ func (m *mySQLClient) deleteVector(ctx context.Context, val string) error {

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return err
}

Expand Down Expand Up @@ -457,7 +457,7 @@ func (m *mySQLClient) SetIPs(ctx context.Context, uuid string, ips ...string) er

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return err
}

Expand Down Expand Up @@ -496,7 +496,7 @@ func (m *mySQLClient) RemoveIPs(ctx context.Context, ips ...string) error {

if m.session == nil {
err := errors.ErrMySQLSessionNil
m.outputLog(err)
m.errorLog(err)
return err
}

Expand All @@ -514,7 +514,7 @@ func (m *mySQLClient) RemoveIPs(ctx context.Context, ips ...string) error {
return tx.Commit()
}

func (m *mySQLClient) outputLog(err error) {
func (m *mySQLClient) errorLog(err error) {
log.Errorf(
"err: %v, { host: %s, port: %d, user: %s, name: %s, db: %s, charset: %s, socketPath: %s, network: %s} ",
err, m.host, m.port, m.user, m.name, m.db, m.charset, m.socketPath, m.network,
Expand Down

0 comments on commit 3217dd4

Please sign in to comment.