зеркало из https://github.com/golang/pkgsite.git
internal/postgres: close prepared statement in InsertVersion
stmt.Close() is called to free any resources used to create a prepared statement for inserting packages inside postgres.InsertVersion. Change-Id: I84ca3128af503b343f0b7f811090ddd8cb9226ab Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/440425 Reviewed-by: Andrew Bonventre <andybons@google.com>
This commit is contained in:
Родитель
18e6a51c96
Коммит
e3aae5f686
|
@ -388,6 +388,7 @@ func (db *DB) InsertVersion(version *internal.Version) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("error preparing package stmt: %v", err)
|
||||
}
|
||||
defer stmt.Close()
|
||||
|
||||
for _, p := range version.Packages {
|
||||
if _, err = stmt.Exec(p.Path, p.Synopsis, p.Name, version.Version, version.Module.Path, version.VersionType.String()); err != nil {
|
||||
|
|
Загрузка…
Ссылка в новой задаче