fix: close all stmt

This commit is contained in:
a631807682 2022-10-19 14:21:07 +08:00
parent 638805ed62
commit 6ae2f6b00a
No known key found for this signature in database
GPG Key ID: 137D1D75522168AB

View File

@ -45,7 +45,12 @@ func (db *PreparedStmtDB) Close() {
}
func (db *PreparedStmtDB) Reset() {
db.Close()
db.Mux.Lock()
defer db.Mux.Unlock()
for _, stmt := range db.Stmts {
go stmt.Close()
}
db.PreparedSQL = make([]string, 0, 100)
db.Stmts = map[string](*Stmt){}
}