fix: delete one by one

This commit is contained in:
a631807682 2022-10-19 14:44:14 +08:00
parent 678adb3e2f
commit d679d620ca
No known key found for this signature in database
GPG Key ID: 137D1D75522168AB

View File

@ -47,7 +47,8 @@ func (db *PreparedStmtDB) Close() {
func (db *PreparedStmtDB) Reset() {
db.Mux.Lock()
defer db.Mux.Unlock()
for _, stmt := range db.Stmts {
for query, stmt := range db.Stmts {
delete(db.Stmts, query)
go stmt.Close()
}