Skip to content

Commit 4414c43

Browse files
committed
rename funcs
1 parent 107ea13 commit 4414c43

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

common/persistence/sql/sqlplugin/sqlite/db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ func (mdb *DB) Close() error {
9393
return mdb.DB.Close()
9494
}
9595

96-
return closePolledDBConn(mdb.databaseName, mdb.DB.Close)
96+
return closeSharedDBConn(mdb.databaseName, mdb.DB.Close)
9797
}

common/persistence/sql/sqlplugin/sqlite/db_pool.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ var (
2020
dbPoolMx sync.Mutex
2121
)
2222

23-
// createPolledDBConn creates a new database connection in the dbPool if it doesn't exist.
24-
func createPolledDBConn(databaseName string, createDBConnFn func() (*sqlx.DB, error)) (*sqlx.DB, error) {
23+
// createSharedDBConn creates a new database connection in the dbPool if it doesn't exist.
24+
func createSharedDBConn(databaseName string, createDBConnFn func() (*sqlx.DB, error)) (*sqlx.DB, error) {
2525
dbPoolMx.Lock()
2626
defer dbPoolMx.Unlock()
2727

@@ -41,8 +41,8 @@ func createPolledDBConn(databaseName string, createDBConnFn func() (*sqlx.DB, er
4141
return db, nil
4242
}
4343

44-
// createPolledDBConn closes the database connection in the dbPool if it exists.
45-
func closePolledDBConn(databaseName string, closeFn func() error) error {
44+
// closeSharedDBConn closes the database connection in the dbPool if it exists.
45+
func closeSharedDBConn(databaseName string, closeDBConnFn func() error) error {
4646
dbPoolMx.Lock()
4747
defer dbPoolMx.Unlock()
4848

@@ -53,5 +53,5 @@ func closePolledDBConn(databaseName string, closeFn func() error) error {
5353

5454
delete(dbPool, databaseName)
5555
delete(dbPoolCounter, databaseName)
56-
return closeFn()
56+
return closeDBConnFn()
5757
}

common/persistence/sql/sqlplugin/sqlite/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (p *plugin) createSingleDBConn(cfg *config.SQL) (*sqlx.DB, error) {
8181
return p.createDBConn(cfg)
8282
}
8383

84-
return createPolledDBConn(cfg.DatabaseName, func() (*sqlx.DB, error) {
84+
return createSharedDBConn(cfg.DatabaseName, func() (*sqlx.DB, error) {
8585
return p.createDBConn(cfg)
8686
})
8787
}

0 commit comments

Comments
 (0)