Skip to content

Commit e52665c

Browse files
committed
fix memory leak introduced by healthcheck
1 parent 1d803ea commit e52665c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ func HealthCheck(w http.ResponseWriter, r *http.Request) {
141141
status = "error"
142142
dbStatus = "corrupted"
143143
}
144+
145+
// Close underlying connection pool to avoid memory leaks
146+
if sqlDB, err := tmpDB.DB(); err == nil {
147+
sqlDB.Close()
148+
}
144149
}
145150
}
146151
}

0 commit comments

Comments
 (0)