Use change from outbrain/golib PR
This commit is contained in:
parent
3b21f4db37
commit
e4bb70df43
@ -20,6 +20,7 @@ import (
|
||||
"github.com/github/gh-ost/go/sql"
|
||||
|
||||
"github.com/outbrain/golib/log"
|
||||
"github.com/outbrain/golib/sqlutils"
|
||||
)
|
||||
|
||||
type ChangelogState string
|
||||
@ -1225,6 +1226,7 @@ func (this *Migrator) finalCleanup() error {
|
||||
this.finishedMigrating = true
|
||||
this.applier.FinalCleanup()
|
||||
this.eventsStreamer.FinalCleanup()
|
||||
sqlutils.ResetDBCache()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
11
vendor/github.com/outbrain/golib/sqlutils/sqlutils.go
generated
vendored
11
vendor/github.com/outbrain/golib/sqlutils/sqlutils.go
generated
vendored
@ -144,6 +144,17 @@ func GetDB(mysql_uri string) (*sql.DB, bool, error) {
|
||||
return knownDBs[mysql_uri], exists, nil
|
||||
}
|
||||
|
||||
// Resets the knownDBs cache, used when the DB connections have been closed,
|
||||
// and new connections are needed to access the DB
|
||||
func ResetDBCache() {
|
||||
knownDBsMutex.Lock()
|
||||
defer func() {
|
||||
knownDBsMutex.Unlock()
|
||||
}()
|
||||
|
||||
knownDBs = make(map[string]*sql.DB)
|
||||
}
|
||||
|
||||
// RowToArray is a convenience function, typically not called directly, which maps a
|
||||
// single read database row into a NullString
|
||||
func RowToArray(rows *sql.Rows, columns []string) []CellData {
|
||||
|
Loading…
Reference in New Issue
Block a user